Subject | Re: [IBO] Join/InsertSQL & MasterSource/MasterLinks (Whew!) |
---|---|
Author | TeamIBO |
Post date | 2002-01-30T01:33:41Z |
> In a form to insert AGENT information, I have a join on AGENT/PERSONDoes IBO have any way of knowing what the resulting primary key will
> which requires a InsertSQL statement to insert a new agent. This
> InsertSQL is a stored procedure which uses a generator to create a
> new ALERTKEY/PERSONKEY.
be on the record created by the InsertSQL statement?
If not then IBO has no way to refresh/read the resulting record. It
works when you come back into the form because the record is read as
part of the select - and so the primary key is now known.
Without knowing the details of your InsertSQL it is a bit difficult to
be sure, but you need to duplicate what would normally be done on a
standard table - that is...
Setup GeneratorLinks so that...
Generated_Primary_Key_Field=GENERATOR_NAME
Then have your InsertSQL accept and use the
Generated_Primary_Key_Field as an input parameter. Inside your
InsertSQL you would have something like...
if (Generated_Primary_Key_Field IS NULL) then
Generated_Primary_Key_Field = GEN_ID(GENERATOR_NAME,1);
just like you normally have in insert triggers.
So when you hit insert on the form, IBO will read the generator to
assign a value to the Generated_Primary_Key_Field and when the
InsertSQL is called your code will not create another. This way IBO
knows what the primary key is and can refresh the record after insert.
I hope this makes sense.
--
Geoff Worboys - TeamIBO
Telesis Computing