hi,
Quote:
|
I want to add auto increment field in oracle table. Can anyone tell me how can I add it in oracle?
|
you need to decide whether the auto increment field is a primary key or not.
assume that you have this table employee:-
create table employee(
id number(5),
emp_name varchar2(50),
emp_email varchar2(30)
);
then, you need to create a sequence for that employee table:-
create sequence id_incre
start with 1
increment by 1;
To use it, you can either use it in a trigger or a simple insert command as follow:-
insert into employee values(id_incre.nextval, 'binary','abc@yahoo.com');
Hope this will help you.
Happy trying.
