Subject | RE: [IBO] Foreign key |
---|---|
Author | Malcolm Smith |
Post date | 2002-08-20T01:13:25Z |
Helen,
The error was "ID is a required field".
But your answer solved the problem. Thanks again.
Malcolm Smith
MJ Freelancing
ABN: 30 671 763 146
http://www.mjfreelancing.com
CORintel
ABN: 30 336 110 329
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Tuesday, 20 August 2002 10:59
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] Foreign key
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
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
The error was "ID is a required field".
But your answer solved the problem. Thanks again.
Malcolm Smith
MJ Freelancing
ABN: 30 671 763 146
http://www.mjfreelancing.com
CORintel
ABN: 30 336 110 329
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Tuesday, 20 August 2002 10:59
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] Foreign key
At 10:45 AM 20-08-02 +1000, you wrote:
>Helen,currently
>
>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
>have SELECT* only because I'm getting an error relating to the fact theWhat's the error?
>field is a required field in a key link.
>Additionally I have a trigger/generator on the ID field. When I add a newdefine
>record I get an exception raised. Is this where I need to explicitly
>an InsertSQL command - to trigger the trigger (no pun intended) - I've putNo. You only need to set xxxxxSQL properties yourself if your DML
>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
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/