Home » SQL & PL/SQL » SQL & PL/SQL » Inserting into sequence
Inserting into sequence [message #1770] Tue, 28 May 2002 12:21 Go to next message
ks
Messages: 12
Registered: January 2002
Junior Member
How can I insert a value into a column that has a sequence number insert trigger and overrides the sequence number with the value.
Thanks.
Re: Inserting into sequence [message #1771 is a reply to message #1770] Tue, 28 May 2002 13:04 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Short of actually temporarily disabling your trigger (and that may not even be an option depending on your circumstances)

The trigger either needs to have a WHEN clause (if the trigger deals only with this column):

when new.seq_no is null


or a conditional check in the body:

if :new.seq_no is null then
  select the_seq.nextval into :new.seq_no from dual;
end if;
Previous Topic: search for the first occurrence of a number in a given string
Next Topic: from where i must start ?
Goto Forum:
  


Current Time: Tue May 21 16:26:18 CDT 2024