Subject Re: [IBO] Execute procedure with Returning
Author Robert martin
Hi Helen

That sure helped ! I now understand the process correctly. Thanks for
you help so far.


However.... I now see it working (i.e. I can execute and get back an
incrementing return result. Unfortunately now the procedure seems to
not be adding the record it is supposed to. I have tested this in Flame
Robin and the following ....

EXECUTE PROCEDURE pr_App_NewEntityAddress(1, '1505', NULL, '11', '1',
'1', '1', '1', '1', '1')

returns a result AND inserts a record.

However the EXACT same SQL from an IBOQuery or an IB_DSQL does not add
the record, it just returns the incremented result. The transaction is
commited. Considering the amount of time this is taking me I feel like
I need to be Commited to :)

I can post the full procedure if you feel it would be useful?

Cheers
Rob







Helen Borrie wrote:
> At 11:41 AM 19/10/2009, you wrote:
>
>> Hi Helen
>>
>> Sorry If I am being a bit thick here :)
>>
>> I have my SP set up returning the result (defined in the returns) and
>> returned after calling SUSPEND;
>>
>> On the client side My SQL was
>>
>> EXECUTE PROCEDURE pr_App_NewEntityAddress(:a, :b, :c, :d) RETURNING a
>>
>> I have tried changing it to
>>
>> EXECUTE PROCEDURE pr_App_NewEntityAddress(:a, :b, :c, :d)
>> RETURNING_VALUES(a)
>> and
>> EXECUTE PROCEDURE pr_App_NewEntityAddress(:a, :b, :c, :d)
>> RETURNING_VALUES(:a)
>> and
>> EXECUTE PROCEDURE pr_App_NewEntityAddress(:a, :b, :c, :d)
>> RETURNING_VALUES :a
>> and
>> EXECUTE PROCEDURE pr_App_NewEntityAddress(:a, :b, :c, :d)
>> RETURNING_VALUES a
>>
>> in all cases I get errors. The first to give me 'token unknown
>> RETURNING_VALUES' and the later give me 'token unknown ?'
>>
>> What should me client side SQL be?
>>
>
> Just
> EXECUTE PROCEDURE pr_App_NewEntityAddress(:a, :b, :c, :d)
>
> RETURNING_VALUES and RETURNS are PSQL (a.k.a. Stored procedure and trigger language). They are not available to DSQL.
>
> RETURNING is a specialised keyword implemented Fb 2 for ODS 11 that can return the values that were inserted by an INSERT statement.
>
> Helen
>
>
>
> ------------------------------------
>
> ___________________________________________________________________________
> 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
>
>
>
>
>