Solved

ORA-01008: not all variables bound

Posted on 2014-04-04
6
2,352 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 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 125 total points
ID: 39979688
how do you actually execute that code?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

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…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  â€¦
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
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.

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now