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

Subprocedures in PSQL and EXECUTE BLOCK [CORE1288] #1709

Closed
firebird-automations opened this issue May 30, 2007 · 10 comments
Closed

Subprocedures in PSQL and EXECUTE BLOCK [CORE1288] #1709

firebird-automations opened this issue May 30, 2007 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @kattunga

Is related to QA508

It's necessary to have subprocedures in PSQL because it's the only way to do a recursive procedure and some complex routines in EXECUTE BLOCK.
It would be useful too, to simplify some complex stored procedures without calling other procedures.

Commits: 0293c56 5ae632c FirebirdSQL/fbt-repository@fa4cfbb

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12232 ] => Firebird [ 15590 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

This feature was just committed. They're very simple for now. No access to parent variables nor to call neighbour procedures.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Does recursive sub-procedures really works ?

Try this

execute block
returns (n int)
as
declare procedure p2_sub(x int) returns (y int)
as
begin
if (x = 0)
then y = 0;
else begin
execute procedure p2_sub(:x-1) returning_values :y;
y = y * x;
end
end
begin
execute procedure p2_sub(5) returning_values :n;
end

The same concern about recursive sub-functions

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

No, as I said, "They're very simple for now. No access to parent variables nor to call neighbour procedures.". Neither recursive calls.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Is it planned to be implemented in v3 ?

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

It's not in my immediate plan, but may be.

Access to parent variables are priority IMO.

@firebird-automations
Copy link
Collaborator Author

Commented by: @kattunga

Thank you Adriano!, I was expecting this feature for a long time. it's a shame we can't get it in version 2.5.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA508 [ QA508 ]

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