mcanetvenkat
asked on
How to auto increment in pl sql collumn (LIKE SQL we have identity like wise in pl sql what ?)
How to auto increment in pl sql collumn (LIKE SQL we have identity like wise in pl sql what ?)
EXample i have emp table i have three column empid,empname,empaddress
I need to this empid column autoincerment.
In my pl sql .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could create a sequence and use the sequence directly in your insert statement
CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1;
INSERT INTO emp( empid, empname, empaddress )
VALUES ( emp_seq.NEXTVAL, 'Name','Address' );
CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1;
INSERT INTO emp( empid, empname, empaddress )
VALUES ( emp_seq.NEXTVAL, 'Name','Address' );
Force accepted
AnnieMod
Cleanup Admin
AnnieMod
Cleanup Admin
you have to use sequence for this
HTH
I