devguru001
asked on
ORA-01008: not all variables bound
Hi I am receiving the error for a simple table I made and I don't see why:
CREATE TABLE my_employee
(id NUMBER(4) CONSTRAINT my_employee_id_nn NOT NULL,
last_name VARCHAR2(25),
first_name VARCHAR2(25),
userid VARCHAR2(8),
salary NUMBER(9,2));
INSERT INTO my_employee (id,
last_name,
first_name,
userid,
salary)
VALUES (&id,
'&last_name',
'&first_name',
'&userid',
&salary);
Just played with this at - http://sqlfiddle.com/#!4/4522e/1
ASKER
@Kent, I am trying to use the &sibstitution in the sql statement to prompt for values. & is a placeholder for the variable value. Your fiddle hard codes the values.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Check for & variables like *('&last_name')..
the value which you will pass as an input may be already taking care of this conversion
try to change insert statement like this
INSERT INTO my_employee (id,
last_name,
first_name,
userid,
salary)
VALUES (&id,
&last_name,
&first_name,
&userid,
&salary);
the value which you will pass as an input may be already taking care of this conversion
try to change insert statement like this
INSERT INTO my_employee (id,
last_name,
first_name,
userid,
salary)
VALUES (&id,
&last_name,
&first_name,
&userid,
&salary);
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@Flow01, I am running in Oracle express edition. I think you are correct for saying it has to do with how it is run rather than how it was written.