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

Home -> Community -> Usenet -> c.d.o.server -> Re: After Update Trigger

Re: After Update Trigger

From: sarvan <ksarvanan_at_gmail.com>
Date: 14 Jun 2006 09:08:26 -0700
Message-ID: <1150301306.257966.62670@y43g2000cwc.googlegroups.com>


hi
No it wont update all the rows infact not even the row which it is updating also.The best way to update ur previous entries is either a cursor or you can create before update trigger as mentiond by the previous guy

K Saravanan (wannabe DBA)
dwgabel_at_telus.net wrote:
> Hi, I'm kind of new to oracle (PLSql) and I'm trying to accomplish this
>
> a row in a table is created (REQUEST table) the column is
> Null.(P_AND_I_LEAD_ID).
> later in the workflow the P and I lead is assigned and their ID is
> placed in the column, my goal is to have a trigger to add the sysdate
> to another column in the same table (MY_P_AND_I_ASSINGED_DATE;
>
> I'm just wanting to confirm that this statement won't update ALL of the
> rows.
>
> CREATE OR REPLACE TRIGGER p_and_i_assigned_date_trigger
> AFTER UPDATE OF p_and_i_lead_id
> ON request
> FOR EACH ROW
> WHEN (old.p_and_i_lead_id = NULL )
> BEGIN
> UPDATE request SET my_p_and_i_assigned_date = (select sysdate from
> dual);
> END;
>
> Anyone mind helpling me ?
>
> DG
Received on Wed Jun 14 2006 - 11:08:26 CDT

Original text of this message

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