Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ORA-01008: not all variables bound

Posted on 2014-04-04
6
Medium Priority
?
2,471 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
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 375 total points
ID: 39979688
how do you actually execute that code?
0
Independent Software Vendors: 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!

 
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 21

Assisted Solution

by:flow01
flow01 earned 375 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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 Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

971 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