
If you were logged in you would be able to see more operations.
|
|
|
Issue Links:
|
Duplicate
|
|
This issue is duplicated by:
|
|
CORE-2714
Improve implicit cursor using like FOR loop of Oracle
|
|
|
|
|
|
|
QA Status: |
Done successfully
|
Either explicit (DECLARE AS CURSOR) or implicit (FOR SELECT) PSQL cursors could make their current record available via the cursor name similar to OLD/NEW trigger contexts, thus making the INTO clause optional. In FOR SELECT loops, it requires AS CURSOR clause to be specified. For example:
for
select rdb$relation_id as id, rdb$relation_name as name
from rdb$relations
where rdb$view_blr is null
as cursor tables
do begin
out_id = tables.id;
out_name = tables.name;
suspend;
end
To avoid ambiguities, the colon prefix could be used.
|
Description
|
Either explicit (DECLARE AS CURSOR) or implicit (FOR SELECT) PSQL cursors could make their current record available via the cursor name similar to OLD/NEW trigger contexts, thus making the INTO clause optional. In FOR SELECT loops, it requires AS CURSOR clause to be specified. For example:
for
select rdb$relation_id as id, rdb$relation_name as name
from rdb$relations
where rdb$view_blr is null
as cursor tables
do begin
out_id = tables.id;
out_name = tables.name;
suspend;
end
To avoid ambiguities, the colon prefix could be used. |
Show » |
|
execute block as
begin
for
select id, x from t1 as cursor c1
do begin
for select id, x from t2 where x = :c1.x as cursor c2 do
begin
/* . . . */
end
end
end
Currently this leads to error: "column unknown C1.X"