Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I use Oracle's :NEW inside my delphi program without referring to host variable?

Re: How can I use Oracle's :NEW inside my delphi program without referring to host variable?

From: damorgan <dan.morgan_at_ci.seattle.wa.us>
Date: Thu, 21 Feb 2002 17:04:32 GMT
Message-ID: <3C7528B5.BAEDF690@ci.seattle.wa.us>


One of your problems is
END IF;
END IF; replace it with

END IF;
END; On the Delphi side I can't help you. Triggers do not return values to a front-end. Though they can execute a function or stored procedure that can.

Daniel Morgan

Daniele Cincinnati wrote:

> 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 - 11:04:32 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US