Subject | RE: [IBO] Foreign key |
---|---|
Author | Helen Borrie |
Post date | 2002-08-20T00:59:04Z |
At 10:45 AM 20-08-02 +1000, you wrote:
operations have to be out of the ordinary - for example, calling a stored
procedure to insert rows into multiple tables.
Set GeneratorLinks to have IBO fetch a generator value for your PK in (or
any other col that uses a generator) in inserts, e.g.
MyCol=MyGen
You need to change your BI trigger so that it tests for null, otherwise
you'll get "double-dipping" on the generator...
...
active before insert as
begin
if (new.MyCol is null) then
new.MyCol = gen_id(MyGen, 1);
end
Helen
>Helen,What's the error?
>
>I don't even know what the 'FOR UPDATE' does. I saw it in another demo.
>
>The master table only has two columns, an ID and a DESCRIPTION. I currently
>have SELECT* only because I'm getting an error relating to the fact the
>field is a required field in a key link.
>Additionally I have a trigger/generator on the ID field. When I add a newNo. You only need to set xxxxxSQL properties yourself if your DML
>record I get an exception raised. Is this where I need to explicitly define
>an InsertSQL command - to trigger the trigger (no pun intended) - I've put
>one in and it works so I guess this is correct.
operations have to be out of the ordinary - for example, calling a stored
procedure to insert rows into multiple tables.
Set GeneratorLinks to have IBO fetch a generator value for your PK in (or
any other col that uses a generator) in inserts, e.g.
MyCol=MyGen
You need to change your BI trigger so that it tests for null, otherwise
you'll get "double-dipping" on the generator...
...
active before insert as
begin
if (new.MyCol is null) then
new.MyCol = gen_id(MyGen, 1);
end
Helen