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

Using EXECUTE PROCEDURE syntax on a selectable procedure does not process all rows [CORE3221] #3595

Closed
firebird-automations opened this issue Nov 8, 2010 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Paul Gardner (cantak)

I have a selectable stored procedure that inserts records into various tables, and then returns some fields. The records returned are based on what was inserted so there can be 1 to N records returned. In some cases in my executable code I need this returned data, and in other areas I do not. Therefore, the procedure was implemented as 'SELECT * FROM STORED_PROC(PARAMS)' in some places, and as 'EXECUTE PROCEDURE STORED_PROC(PARAMS)' in other places.

After debugging an issue recently I found that the when the EXECUTE PROCEDURE syntax was used Firebird was not processing all rows in the selectable procedure. As a result only a couple of records were being inserted by the procedure. I changed this to a SELECT syntax, and added an ORDER BY clause in order to force Firebird to process all rows. This took care of my issue.

I'm under the (possibly mistaken) impression that EXECUTE PROCEDURE should simply run until the procedure is done and not have a limitation on fetched records.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

1 - Firebird doesn't have a debugger, so you are using a third-party tool, is it very likely that the problem exists with that tool

2 - EXECUTE PROCEDURE is expected to return a single value/set, it is not equivalent to SELECT * FROM SP

3 - Please post a reproducible case which uses SQL/isql to "prove" that the problem exists in the engine.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

This is as designed.

The procedure executed with EXECUTE PROCEDURE stops just after the execution of the first SUSPEND.

If you wan't they behave different, pass another input parameter and enclose the SUSPEND in a IF testing this value.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

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

1 participant