parsing where_current_of added
This commit is contained in:
@ -1354,7 +1354,11 @@ ASTGroupingExpressionList GroupingExpressionList() :
|
|||||||
ASTWhereClause WhereClause() :
|
ASTWhereClause WhereClause() :
|
||||||
{}
|
{}
|
||||||
{
|
{
|
||||||
|
(
|
||||||
|
LOOKAHEAD(3) <WHERE> <CURRENT> <OF> Expression()
|
||||||
|
|
|
||||||
<WHERE> Condition()
|
<WHERE> Condition()
|
||||||
|
)
|
||||||
{ return jjtThis; }
|
{ return jjtThis; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,4 +85,9 @@ public class WhereClauseTest extends AbstractPLSQLParserTst {
|
|||||||
public void testParentheses() {
|
public void testParentheses() {
|
||||||
plsql.parseResource("WhereClauseParens.pls");
|
plsql.parseResource("WhereClauseParens.pls");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCurrentOf() {
|
||||||
|
plsql.parseResource("WhereCurrentOf.pls");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
declare
|
||||||
|
thisstudent student%rowtype;
|
||||||
|
|
||||||
|
cursor maths_student is
|
||||||
|
select *
|
||||||
|
from student
|
||||||
|
where sid in (select sid
|
||||||
|
from take
|
||||||
|
where cid = ’cs145’)
|
||||||
|
for update;
|
||||||
|
|
||||||
|
begin
|
||||||
|
open maths_student;
|
||||||
|
loop
|
||||||
|
fetch maths_student
|
||||||
|
into thisstudent;
|
||||||
|
exit when(maths_student%notfound);
|
||||||
|
if (thisstudent.gpa < 4.0) then
|
||||||
|
update student
|
||||||
|
set gpa = 4.0
|
||||||
|
where current of maths_student;
|
||||||
|
end if;
|
||||||
|
end loop;
|
||||||
|
|
||||||
|
close maths_student;
|
||||||
|
end;
|
Reference in New Issue
Block a user