View previous topic :: View next topic
|
Author |
Message |
kishpra
New User
Joined: 24 May 2010 Posts: 92 Location: Pune
|
|
|
|
Hi,
i want to insert a row in a table where one col emp_id is set as auto increment e.g.
INSERT INTO
(
col1
emp-id
col2
)
VALUES
(:col1
?
:col2)
Please let me know what ? should be replaced with?
Thanks |
|
Back to top |
|
|
harithb
New User
Joined: 08 Jun 2009 Posts: 15 Location: Bangalore
|
|
|
|
Hi Kishpra,
This would require a sequence to be created first and the NEXTVAL function should be used to assign values to the column.
CREATE SEQUENCE employee_id AS INTEGER
Then use
INSERT INTO
(
col1
emp-id
col2
)
VALUES
(:col1
NEXT VALUE for employee_id
:col2)
Regards,
Haritha. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
Back to top |
|
|
|