Solved

ORA-01008: not all variables bound

Posted on 2014-04-04
6
2,435 Views
Last Modified: 2014-04-05
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
Comment
Question by:devguru001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 17

Expert Comment

by:Kent Dyer
ID: 39979657
Just played with this at - http://sqlfiddle.com/#!4/4522e/1
0
 

Author Comment

by:devguru001
ID: 39979662
@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
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 125 total points
ID: 39979688
how do you actually execute that code?
0
Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

 
LVL 16

Expert Comment

by:Wasim Akram Shaik
ID: 39979710
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
 
LVL 20

Assisted Solution

by:flow01
flow01 earned 125 total points
ID: 39979754
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
 

Author Comment

by:devguru001
ID: 39979762
@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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question