Subject Re: [IB-Architect] Insert Returning
Author Vince Duggan
Ann Harrison asked:
> How would you expect this statment to behave?
>
> insert into <table> (<col list>)
> select <val list> from <select expression>
> returning <val list>
> into <var list>


and Jason replied that one could limit this to single row inserts and
updates:

> insert into <table> ( <col list> )
> values ( <param list > )
> returning <col list>

I tend to agree, since no cursor needs to be created (in order to return
multiple rows), and existing API calls already cater for single row
result sets.

However, if the engine internals can easily be modified so that an
INSERT statement can create a cursor, and return multiple rows, then it
may be worthwhile. I suspect the single row option will be very useful,
but the multiple row option may be less useful, and may not be worth the
effort. Perhaps someone can think up a scenario where multiple return
rows will be useful - given that you may not have any control over the
order of returned rows, and so may have trouble matching returned rows
with 'input' rows...

Vince


--
Vince Duggan
Synectics Software
Inprise C/S Business Partner
South Africa
http://www.synectics.co.za
mailto:vince@...