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

Home -> Community -> Usenet -> comp.databases.oracle -> Re: How to fill empty column with number sequence?

Re: How to fill empty column with number sequence?

From: Jia Lian Chang <chang4_at_cox.net>
Date: Fri, 13 Feb 2004 14:22:36 -0500
Message-ID: <4u9Xb.44239$Ii2.29895@lakeread03>

You can create a temporary trigger that fires on updates. It will be somewhat similar to your insert trigger, e.g.   if (:new.id = -1) then
    :new.id := seq_name_at_nextval;

Then, just update your whole table:
  update tablename

       set id = -1;

Remove the temporary update trigger after that. Received on Fri Feb 13 2004 - 13:22:36 CST

Original text of this message

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