Subject Re: [IB-Architect] Insert Returning
Author Jason Wharton

> Fine. But how would you expect this statement to behave?
> insert into <table> (<col list>)
> select <val list> from <select expression>
> returning <val list>
> into <var list>

I would make it so that it is only in the case of singleton inserts and not
the case where it allows a SELECT to batch insert records.

Then, when it is prepared, there would be an output buffer for the columns
specified in the returning list. I don't think it would be necessary for
DSQL to have the INTO clause either.

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

So, upon calling the isc_dsql_execute2() API call it would take the input
parameters and immediately return the output parameters.

Could I please ask for a similar capability to be added to the UPDATE

update <table>
set <acol> = <aexpr>
where <singleton select criteria>
returning <col list>

This way the BufferSynchroFlags property of my buffered dataset wouldn't
have to parse together and execute so much stuff to do this through the
existing DSQL interface.

This would make a lot of my hard work seem to be a waste but a clean
solution is a clean solution!

Jason Wharton
CPS - Mesa AZ