Link to home
Start Free TrialLog in
Avatar of devguru001
devguru001Flag for South Africa

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);

Open in new window

Avatar of Kent Dyer
Kent Dyer
Flag of United States of America image

Just played with this at - http://sqlfiddle.com/#!4/4522e/1
Avatar of devguru001

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
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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);
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@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.