Home » RDBMS Server » Server Administration » help .. sequence
help .. sequence [message #371798] Thu, 07 December 2000 11:02 Go to next message
asma
Messages: 12
Registered: December 2000
Junior Member
We create a sequence to genareate confirmation number to the customer but we want the way (command) that we can use it in procedure to genarete and insert confirmation number (confirmation#) in field in the table....

thanx
Re: help .. sequence [message #371800 is a reply to message #371798] Thu, 07 December 2000 13:05 Go to previous message
Madhav Kasojjala
Messages: 42
Registered: November 2000
Member
Hi,
If I understand correctly what you are asking is to insert a Sequence into one of the columns of a table directly without user typing in.
If this is correct,
you can write a before insert database trigger
on that table which fires for each row...

the code will look like
create or replace trigger ins_CustTable
.....
...
begin
select Sequence_Name.Nextval
into :new.confirmation_Number
from dual;
--where confirmation_number is the column in
--CustTable where u are trying to insert.
end;

goodluck
Madhav
Previous Topic: Encryption and Decryption
Next Topic: PRIMARY KEY and performance
Goto Forum:
  


Current Time: Thu May 02 04:12:46 CDT 2024