Re: * HELP * - Using :NEW in a trigger
Date: 22 Feb 95 22:35:41 GMT
Message-ID: <Spencer.H.Moore.9.2F4BBC3D_at_tek.com>
In article <Spencer.H.Moore.8.2F4B66E9_at_tek.com> Spencer.H.Moore_at_tek.com (Spencer H Moore) writes:
>From: Spencer.H.Moore_at_tek.com (Spencer H Moore)
>Subject: Re: * HELP * - Using :NEW in a trigger
>Date: Wed, 22 Feb 1995 16:31:37 GMT
>In article <3idlkn$3ks_at_alterdial.UU.NET> Morgan Skinner <morgan_at_odo.fisons-lims.com> writes:
>>From: Morgan Skinner <morgan_at_odo.fisons-lims.com>
>>Subject: Re: * HELP * - Using :NEW in a trigger
>>Date: 21 Feb 1995 21:23:35 GMT
>>bill.holmes_at_gsa.gov (Bill Holmes) wrote:
>>>
>>> :new and :old enable your trigger to access column values, e.g.
>>> 'if :new.sal > 10000' or 'if :new.sal < :old.sal'.
>>Yep, I know that. What I want to do is to be able to pass the whole
>>record to another stored procedure, where I will access any of the
>>field values as necessary. I need to know if it is possible to pass
>>:NEW from a trigger to another stored procedure.
>>Thanks in advance.
>This isn't possible (at least if it is, I'd like to know!). Nor is it
>possible to pass a record declared as <table>%ROWTYPE to another procedure or
>function. That is, I haven't been able to do it yet.
>Spencer Moore
Oops! Should have kept my mouth shut! It turns out that passing <table>%ROWTYPE to another procedure or function is possible. What I was trying (and failed) to remember was that the following is not possible:
delcare
emp_rec emp%ROWTYPE;
begin
select * from emp into emp_rec;
emp_rec.emp_id := 12345
insert into emp values (emp_rec); /* WRONG */
end;
Sorry to have volunteered incorrect information.
Spencer Moore Received on Wed Feb 22 1995 - 23:35:41 CET