Subject Re: [Firebird-Architect] Re: RFC: Please unify stored procedure execution
Author Dmitry Yemanov
"Dimitry Sibiryakov" <SD@...> wrote:
>
> >4) Add CALL statement (BTW, this is a standard syntax for procedures,
> >see SQL-99) which cares about output parameters and return either a
> >single set of outputs or a cursor and hence will be described as
> >either select or execute. But what should be a PSQL syntax to retrieve
> >a cursor? Or will this be a client-only thingy?
>
> If I'm not mistaken, you implemented full cursors' support for PSQL
> in 2.0 including DECLARE CURSOR, FETCH and so on. May CALL return a
> CURSOR?

Nope. We'll need a new iteration construct for PSQL.

> What should return the procedure above if it is called with CALL?
> Should a coder use isc_dsql_free_statement() with DSQL_close after
> executing CALL statement? Should data in buffers be filled right
> after call isc_dsql_execute() or isc_dsql_fetch() is required?

1) CALL can be used for all types of procedures
2) It's described depending on its output params existence to be either
select or execute (like EXEC BLOCK behaves)
3) You either execute it immediately or fetch rows + do DSQL_close depending
on (2)


Dmitry