Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> How can I use Oracle's :NEW inside my delphi program without referring to host variable?
I've got to create (in Oracle) a trigger which refers to field 'myfield' of
the new inserted row (:NEW.myfield). This trigger is created by means of a
sql script in delphi language; the sql script is executed by
TAdoQuery.ExecSql method but :NEW.myfield is treated like a host variable
and not like the new inserted row! Any idea how I can solve my problem?
Here is the sql script:
CREATE TRIGGER trig1 BEFORE INSERT
ON Table1 FOR EACH ROW
DECLARE DUMMY INTEGER;
BEGIN
SELECT COUNT(*)
INTO DUMMY
FROM TA_TERR
WHERE Id = :NEW.myfield;
IF DUMMY = 0 THEN
RAISE_APPLICATION_ERROR( -20501,'Error');
END IF;
END IF;
Thanks!
Received on Thu Feb 21 2002 - 07:26:13 CST