Error when creating a trigger
Posted: Fri 08 Apr 2005 08:18
Just downloaded, and installed dbexpoda.dll, version 2.50.2.
From Delphi2005 I want to create a trigger in code.
I use a ClientDataSet and sets CommandText to:
CREATE OR REPLACE TRIGGER MYTEST_TRIG before insert on MYTEST
for each row
begin
select MYTEST_SEQ.nextval into :new.logid from dual;
end;
where logid is the column in the oracle table MYTEST that I want to automatically get a new id from the sequence MYTEST_SEQ.
When I execute this code from Delphi I get an EDatabaseError:
"No value for parameter 'new.logid'"
The sql-code IS correct, if I run it from Toad e.g. it creates the trigger without problem, and it also works later on when doing inserts.
I guess the problem is that "something", which I believe is the dbexpress driver, interprets ":new.logid" to be a parameter (the colon), which it isn't in this case!
Surely there must be a way around this? Bug? Am I missing something?
Best regards,
Anders H
(By the way, the new dll which you call 2.50.2 is still listed in the file explorer as file version.2.50.0.0)
From Delphi2005 I want to create a trigger in code.
I use a ClientDataSet and sets CommandText to:
CREATE OR REPLACE TRIGGER MYTEST_TRIG before insert on MYTEST
for each row
begin
select MYTEST_SEQ.nextval into :new.logid from dual;
end;
where logid is the column in the oracle table MYTEST that I want to automatically get a new id from the sequence MYTEST_SEQ.
When I execute this code from Delphi I get an EDatabaseError:
"No value for parameter 'new.logid'"
The sql-code IS correct, if I run it from Toad e.g. it creates the trigger without problem, and it also works later on when doing inserts.
I guess the problem is that "something", which I believe is the dbexpress driver, interprets ":new.logid" to be a parameter (the colon), which it isn't in this case!
Surely there must be a way around this? Bug? Am I missing something?
Best regards,
Anders H
(By the way, the new dll which you call 2.50.2 is still listed in the file explorer as file version.2.50.0.0)