Possible Duplicate:
Autoincrement in Oracle
I have a table in oracle and I want to make userid auto increment.. Once I make it auto increment by using sequence and try to insert into table using procedure where do i put my sample.seq_userid How do i insert userid? do i have to declare it in my procedure?
PROCEDURE insertExample
(
name_in IN sample.name%TYPE,
age_in IN sample.age%TYPE
)
IS
BEGIN
INSERT INTO sample
(name, age)
VALUES
(name_in, age_in);
END insertExample;
here is my update one
PROCEDURE updateExample
(
userid_in IN sample.userid%TYPE,
name_in IN sample.name%TYPE,
age_in IN sample.age%TYPE
)
IS
BEGIN
UPDATE sample
SET name = name_in,
age = age_in
WHERE userid = userid_in;
END updateExample;