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_at_lakeread03>
Date: Fri, 13 Feb 2004 14:22:36 -0500
Message-ID: <4u9Xb.44239$Ii2.29895_at_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 - 20:22:36 CET