Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow referencing cursors as record variables in PSQL [CORE4403] #4725

Closed
firebird-automations opened this issue Apr 24, 2014 · 13 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dyemanov

Is duplicated by CORE2714

Votes: 3

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 = http://tables.id;
out_name = http://tables.name;
suspend;
end

To avoid ambiguities, the colon prefix could be used.

Commits: d7b5b1a db03538 3f8de25 FirebirdSQL/fbt-repository@abe97ce FirebirdSQL/fbt-repository@36b25b0 FirebirdSQL/fbt-repository@03f4f5f

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Fix Version: 3.0 Beta 1 [ 10332 ]

Fix Version: 3.0 Beta 2 [ 10586 ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

It will be useful to implement ability to reference record variable via cursor like this:

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"

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

I'll check it.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Please test the fix.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Checked on LI-T6.3.0.31152. Seems that OK.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is duplicated by CORE2714 [ CORE2714 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done with caveats

Test Details: TODO: uncomment block with "execute procedure sp_test(ce.x) returning_values(ce.y);" after CORE4819 will be fixed.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done with caveats => Done successfully

Test Details: TODO: uncomment block with "execute procedure sp_test(ce.x) returning_values(ce.y);" after CORE4819 will be fixed. => Works OK since build 31846.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

Test Details: Works OK since build 31846. =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants