Re: before/after image assignment in triggers

From: Lawrence James <james.lawrence_at_epamail.epa.gov>
Date: 1996/02/09
Message-ID: <james.lawrence.164.00102D88_at_epamail.epa.gov>#1/1


In article <1996Jan26.003650.18492_at_rosevax.rosemount.com> mark rostron <markro2_at_atlantis.rosemount.com> writes:
>From: mark rostron <markro2_at_atlantis.rosemount.com>
>Subject: before/after image assignment in triggers
>Date: Fri, 26 Jan 1996 00:36:50 GMT
 

>Hi,
 

>We are doing a lot of parallel development to table behaviour with different
>programming groups needing to set values in a table row prior to insertion/update.
>In order to avoid treading on each others' toes, we have decided to minimise
>specific coding in the trigger and do it all in separate procedures, and merge them
>in the trigger, somehow.
 

>I also want to avoid creating procedures with long parameter lists on account of
>they become a maintainer's nightmare.
 

>Now, I know the following syntax is valid:
>--
>declare
> row table%rowtype;
>begin
> procedure_call(row);
>end;
>--
 

>where the procedure_call definition is:
 

> procedure_call(p_row inout table%rowtype)
 

>Being able to pass an image of the table row will solve a maintenance problem, BUT:
 

>I cant do this:
 

> row := :new;

I don't think 'new' is a record. It's simply a qualifier. Can't see anyway except to assign each individual value. You should be able to to that once in the trigger and then make all the calls you want using the record.

Lawrence.....

>or whatever it's correct definition is. Can anyone please tell me a way?
 

>ps: I have tried the following alternatives:
>- passing the id of the row; doesn't work till the row exists
>- post-processing instead of pre-processing: has some drawbacks
 

>If all else fails, we'll revert to using specialist parameter calls.
 

>thanx,
>mr
Received on Fri Feb 09 1996 - 00:00:00 CET

Original text of this message