4GL & returning from Stored Proc
Posted in 2000
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
I have a stored procedure that returns an integer status. Is there a way to execute this procedure from 4GL, and retrieve the integer status? The 'returning' clause generates a compile error. I used 'prepare' prior to executing the stored proc. Thanks, Joel Sent via Deja.com http://www.deja.com/ Before you buy.
This is a possible solution that I have applied in my own programs, that not requires the use of the 'prepare', and the subsequent 'execute' or 'fetch': - Define a variable to get the returning value: e.g. return_value. - Write the next instructions to execute and capture the return: sql execute procedure 'name_procedure'('parameters') into $return_value end sql With the 'sql ... end sql' you can execute any SQL instructions not built directly in 4GL language. An important question: if any of the parameters are 4GL variables, they have to go with the '$' prefix. And you can't use the '.*' form to pass complex variables (records). jwz1@my-deja.com wrote: > I have a stored procedure that returns an integer status. Is there a > way to execute this procedure from 4GL, and retrieve the integer > status? The 'returning' clause generates a compile error. I > used 'prepare' prior to executing the stored proc. > > Thanks, > > Joel > > Sent via Deja.com http://www.deja.com/ > Before you buy.