• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2548
  • Last Modified:

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

0
devguru001
Asked:
devguru001
2 Solutions
 
Kent DyerIT Security Analyst SeniorCommented:
Just played with this at - http://sqlfiddle.com/#!4/4522e/1
0
 
devguru001DevAuthor Commented:
@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.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
how do you actually execute that code?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Wasim Akram ShaikCommented:
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);
0
 
flow01Commented:
If you are exuting the command in sqlplus
then enter first the command
set scan on
It will prompt you for the argument.
If you are using another tool search for a simular setting to enable arguments at runtime
0
 
devguru001DevAuthor Commented:
@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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now