Subject Re: [IBO] Return values from stored procedure
Author Helen Borrie
At 09:34 AM 29/05/2004 +0800, you wrote:
>Hi Steve
>Steve Harp wrote:
>
> > Hi All,
> >
> > I'm trying to get a return value from a stored procedure using a TIB_DSql
> > component. I tried
> > execute procedure spClearIxTables returning_values :pSuccess;
> >
> > but it barfed on the returning_values thing. Obviously, there's another
> > way.
> >
> > Thanks for any help,
> >
> > Steve
>
>My way of doing this task is using a TIB_Query with this sql instead
>"select sSuccess from spClearIxTables"

This is *not* a good idea. First, you must make it a selectable stored
procedure (using SUSPEND) and secondly, by selecting the return value, you
are extending the life of the transaction, when you really need to commit
it. This is a general rule for SPs - if you're doing DML, don't make it a
selectable procedure.

If an executable (i.e. DML) procedure has a RETURNS clause, then IBO
recognizes the return parameters and you can (1) get their metadata after
Prepare and (2) read their values after execution, via the Fields[] array.

Helen