Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: automatic update of a variable in pl/sql
Mark C. Stock wrote:
> "DA Morgan" <damorgan_at_x.washington.edu> wrote in message
> news:1111593806.118041_at_yasure...
>
>>Laura Martignas wrote: >> >> >>>Hi, >>> >>>In PL/SQL, is it possible to declare a variable that will be updated each >>>time a field of a table will have its value changed ? >>> >>>For example, the attribute %TYPE update the type of a variable each time >>>the type of a field is changed. Is it possible to have the same thing not >>>for the type of the field, but for its value ? >>> >>>Thanks >>>Laura >> >>Not in the variable's declaration but the result can be accomplished by >>a different mechanism. >> >>First create a global variable by defining it in a package header and >>write a function in the package body that updates it. >> >>Then write an AFTER INSERT OR UPDATE trigger on the table setting the >>variable when the trigger fires and no exception is raised. >> >>If you do this test it carefully as there may be issues related to your >>implementation. >>-- >>Daniel A. Morgan >>University of Washington >>damorgan_at_x.washington.edu >>(replace 'x' with 'u' to respond)
Or certainly using Advanced Queuing but that would be a lot of work for something that may be better handled with reconsidering the design.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Sat Mar 26 2005 - 11:26:34 CST