Skip to content

EXECUTE BLOCK and STORED PROCEDURE LANGUAGE and singleton execution [CORE3695] #4043

Open
@firebird-automations

Description

@firebird-automations

Submitted by: @jasonwharton

When an execute block statement is written with output variables, it appears to be required to include a SUSPEND call so that it will actually return the output values. I am told the same applies with stored procedures as well. When such statements are created and they are parsed, if there are output variables and no call to SUSPEND was detected in the body of the entire statement, the parser should go ahead and include a final call to SUSPEND as if it had been written into the body of the execute block or stored procedure. In this way, if no call to SUSPEND is made and there are output variables, the statement will function properly when called via ISC_DSQL_EXECUTE2(). As it is now, an exception is returned that an attempt to read past the end of the cursor was made. This will allow more flexibility to have clean execute block and stored procedure statements that are purely for use as singleton statements.