Subject | Sync an inserted record with ID provided by a SP, any trick? |
---|---|
Author | Marco Menardi <mmenaz@lycosmail.com> |
Post date | 2003-02-20T18:30:59Z |
I have a query that returns a left joined dataset and uses a stored
procedure in the EditSQL.
This is because the join creates an "empty table" that in IB_Grid I
can fill, and the stored procedure checks if the primary_id is not
null, then it's an update, otherwise it's an edit.
The problem is that I can't get the primary_id in advance as usual,
but since I need the buffer to be synchronized after the edit
(SyncAfterEdit) and if I "edit" an empty row I've no primary key to do
the sync, I'm in troubles :(
Is there any property/trick to add to my stored procedure the
returning of the primary_id and have IBO use for locate the record and
update the buffers?
If not, wouldn't it be a very nice improvements in IB_Query? (I'm
thinking about a flag, like SPReturnsKeyLinks, that means that the SP
that you put in insert/update has returning values with the same name
and type of the IB_Query keylink).
Thanks in advance
Marco Menardi
Btw, I could call another SP in the beforepost event to return the
primary_id with a flag that tells me if has been created or has been
found, but how could I pass this flag to the SP that actually performs
the update/insert?
procedure in the EditSQL.
This is because the join creates an "empty table" that in IB_Grid I
can fill, and the stored procedure checks if the primary_id is not
null, then it's an update, otherwise it's an edit.
The problem is that I can't get the primary_id in advance as usual,
but since I need the buffer to be synchronized after the edit
(SyncAfterEdit) and if I "edit" an empty row I've no primary key to do
the sync, I'm in troubles :(
Is there any property/trick to add to my stored procedure the
returning of the primary_id and have IBO use for locate the record and
update the buffers?
If not, wouldn't it be a very nice improvements in IB_Query? (I'm
thinking about a flag, like SPReturnsKeyLinks, that means that the SP
that you put in insert/update has returning values with the same name
and type of the IB_Query keylink).
Thanks in advance
Marco Menardi
Btw, I could call another SP in the beforepost event to return the
primary_id with a flag that tells me if has been created or has been
found, but how could I pass this flag to the SP that actually performs
the update/insert?