Subject [IBO] Re: RETURNING_VALUES KeyWord failing
Author constantijnw
--- In IBObjects@yahoogroups.com, "Filipe Belchior"
<filipe.belchior@m...> wrote:
> Constantijn,
>
> is it?
>
> in a TIB_DSQL.SQL.TEXT
> "EXECUTE PROCEDURE sp_geraconta_so (:P1, :P2, :P3, :P4) RETURNING_VALUES
> :Rows_Aff"

Not quite. You're still using PSQL syntax. Take a look again at my
posting. Also query the archive for some recent threads on this
subject (I think the same question has been asked and answered).

>
> , after...
>
> TIB_DSQL.prepare... provide values for inputparameters...

Yes. What prepare does is having the server allocate resources and do
some optimizing. If he doesn't know how your statement looks like he
can't do anything.

After a prepare you fill inputparamters execute it, fill another set
of paramter and execute then, and so on.

>
> ,Execute...
>
> And finally, you retrieve the outputparameter via the Fields property:
>
> ok?

Yes. But why do you include "RETURNING_VALUES :Rows_Aff stuff" in you
statement above then?

>
>
> ----- Original Message -----
> From: "constantijnw" <cw.s@x...>
> To: <IBObjects@yahoogroups.com>
> Sent: Thursday, July 08, 2004 3:29 PM
> Subject: [IBO] Re: RETURNING_VALUES KeyWord failing
>
>
> >
> > Hi Filipe,
> >
> > > I am calling an "EXECUTE PROCEDURE" in a TIB_DSQL.
> > > But occurs an exception: "Token unknown: RETURNING_VALUES".
> > >
> > > SQL:
> > > EXECUTE PROCEDURE sp_geraconta_so "07/2004", 50, 20, 30
> > > RETURNING_VALUES :Rows_Aff
> > >
> >
> > You can't use Firebirds PSQL (procedure/trigger) language outside the
> > server.
> >
> > Your SP takes 4 inputparameters (lets say P1, P2, P3, P4), executes a
> > DML statement and returns ROW_COUNT via the Rows_Aff outputparameter.
> > Right?
> >
> > Then the SQL statement in TIB_SQL looks like this:
> > EXECUTE PROCEDURE sp_geraconta_so (:P1, :P2, :P3, :P4);
> >
> > You provide values for those parameters (after a prepare) via the
> > Params property:
> > sp_geraconta_so.ParamByName('P1').AsString := '07/2000';
> > etc. for all other inputparameters
> >
> > You execute this SP via:
> > sp_geraconta_so.Execute;
> >
> > And finally, you retrieve the outputparameter via the Fields property:
> > RowsAff := sp_geraconta_so.FieldByName('Rows_Aff').AsInteger;
> >
> > Constantijn
> >
> >
> >
> >
> >
> >
> >
>
___________________________________________________________________________
> > IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> > without the need for BDE, ODBC or any other layer.
> >
>
___________________________________________________________________________
> > http://www.ibobjects.com - your IBO community resource for Tech Info
> papers,
> > keyword-searchable FAQ, community code contributions and more !
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >