Home » Developer & Programmer » Designer » Sequence
Sequence [message #90592] Tue, 04 May 2004 23:32 Go to next message
Chandra Kishor Ravi
Messages: 4
Registered: April 2004
Junior Member
How to add a sequence to a table  ?

 

plz help me.
Re: Sequence [message #90601 is a reply to message #90592] Sun, 09 May 2004 22:43 Go to previous message
abcd
Messages: 7
Registered: November 2001
Junior Member
You do not add sequences to a table. You add sequences to the schema and then use the sequence to populate some column in your table. Let's say your table is :

incident_report( report_uid number, report_name varchar2(20) );

and you want to populate the "report_uid" column thru a sequence, then first create a sequence as :

create sequence report_seq start with 1 increment by 1;

Now, use it to populate your table:

insert into incident_report ( report_uid, report_name ) values ( report_seq.nextval, 'Test Report') ;

commit;

HTH
Previous Topic: Default Database
Next Topic: constraint
Goto Forum:
  


Current Time: Thu Mar 28 21:37:54 CDT 2024