parsing where_current_of added

This commit is contained in:
Piotr Szymanski
2020-03-04 17:22:15 +01:00
parent f698a2e7aa
commit 97043a75c5
3 changed files with 35 additions and 0 deletions

View File

@ -1354,7 +1354,11 @@ ASTGroupingExpressionList GroupingExpressionList() :
ASTWhereClause WhereClause() :
{}
{
(
LOOKAHEAD(3) <WHERE> <CURRENT> <OF> Expression()
|
<WHERE> Condition()
)
{ return jjtThis; }
}

View File

@ -85,4 +85,9 @@ public class WhereClauseTest extends AbstractPLSQLParserTst {
public void testParentheses() {
plsql.parseResource("WhereClauseParens.pls");
}
@Test
public void testCurrentOf() {
plsql.parseResource("WhereCurrentOf.pls");
}
}

View File

@ -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;