Pankaj,
Let's say your table is
my_table( my_id number, my_column varchar2(10) )
Create a database sequence in Oracle as follows:
create sequence my_sequence start with 1 increment by 1 ;
Then, while inserting a record in the table "my_table", use the following command:
insert into my_table ( my_id, my_column ) values ( my_sequence.nextval, 'abcd' );
The construct "my_sequence.nextval" will give the value 1 the first time it is invoked and will increment thereafter. To check the current value, execute the following command:
select my_sequence.currval from dual;
Hope that helps.
Cheers,
AM
|