Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 

 

PL/SQL ORA-01008 : Not all variables bound
 


Question:  I am trying to run this pl/sql code but getting the error ORA-01008 : Not all variables bound below. Any idea what’s wrong?

ORA-01008 : Not all variables bound


DECLARE

myoper varchar(12);
oper varchar(12);
loti varchar(12);
prod varchar(25);
quant varchar(12);

CURSOR C1 IS

SELECT nOperno FROM d2f_prod_0_report.factoryloops
WHERE wtflag = 'Y' ORDER BY ecdorder;

BEGIN

OPEN C1;

LOOP

FETCH C1 INTO myoper;
SELECT operation , Lot , Product , Qty1
FROM d2f_prod_0_report.f_lot
WHERE operation = :myoper
AND Route = 'SL00.2RZS'
AND Product LIKE '%IX190%';

END LOOP;

CLOSE C1;

END;

ORA-01008 : Not all variables bound

 

Answer by Edward Stoever:

The err utility shows this for the ORA-01008 error:

ORA-01008 not all variables bound

Cause: A SQL statement containing substitution variables was executed without all variables bound. All substitution variables must have a substituted value before the SQL statement is executed.

Action: In OCI, use an OBIND or OBINDN call to substitute the required values

Lots wrong here... you are attempting to use a bind variable (:myoper) that is not bound to a value.

Also, your select statement



SELECT
   operation ,
   Lot ,
   Product ,
   Qty1
FROM
    d2f_prod_0_report.f_lot
WHERE
   operation = :myoper
AND
   Route = 'SL00.2RZS'
AND
   Product LIKE '%IX190%';

needs to "select into", because you cannot simply select like that in PL/SQL. If you think about it, it makes sense; if you don't select into, or open a cursor so that the values can be of use, then you are just selecting to waste time, and that will not compile.

 
 
 
Get Complete Oracle Tuning Details 

The landmark book "Oracle Tuning: The Definitive Reference Third Edition" has been updated with over 800 pages of expert performance tuning tips. It's packed with scripts and tools to hypercharge Oracle performance and you can buy it for 40% off directly from the publisher.
 

 

 


 

 

��  
 
 

 
 
 
 
oracle dba poster
 

 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2014

All rights reserved by Burleson

Oracle © is the registered trademark of Oracle Corporation.