This content has been marked as final. Show 4 replies
You can't have multiple parameters with the same name.
This is a very odd way of writing a procedure for an insert. You will always have to call it with three empno. Really?
Why not use 1 parameter and insert 1 row.
And remove the commit. Leave that up to the calling environment.
These IN Parameters should insert as rows in emp table into empno column
For example :
Well the thread title 'Proc with little Logic' is certainly appropriate since there is little logic to having a proc like that.
Just use three insert statements
INSERT INTO EMP (EMPNO) VALUES (p_val1); INSERT INTO EMP (EMPNO) VALUES (p_val2); INSERT INTO EMP (EMPNO) VALUES (p_val3);
CREATE TABLE sample_insert(empno NUMBER); CREATE PROCEDURE insert_empno (p_val1 NUMBER, p_val2 NUMBER, p_val3 NUMBER) IS BEGIN INSERT INTO saminsert VALUES (p_val1); INSERT INTO saminsert VALUES (p_val2); INSERT INTO saminsert VALUES (p_val3); END; BEGIN insert_empno (10, 20, 30); END; SELECT * FROM sample_insert; EMP_NO 10 20 30
Edited by: Gurujothi on 20 Nov, 2012 9:38 AM