my dog learned polymorphism*
The moose likes JDBC and the fly likes  ORA-01008: not all variables bound trying to call CallableStatement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark " ORA-01008: not all variables bound trying to call CallableStatement" Watch " ORA-01008: not all variables bound trying to call CallableStatement" New topic
Author

ORA-01008: not all variables bound trying to call CallableStatement

vikram nalagampalli
Ranch Hand

Joined: Oct 08, 2001
Posts: 91
I am trying to call the following PLSQL and I get ORA-01008: not all variables bound

I was not able to find the missing variable as all of them are set properly

CREATE OR REPLACE PROCEDURE XXORT_INSERT_DISPOSITION
( p_orgCode INVARCHAR2
, p_orderNum IN VARCHAR2
, p_item IN VARCHAR2
, p_lot INVARCHAR2
, p_qty INNUMBER
, p_subInv INVARCHAR2
, p_status INVARCHAR2
, p_createDate IN VARCHAR2
, p_createBy INVARCHAR2
, p_updateDate IN VARCHAR2
, p_updateBy INVARCHAR2
)
IS

BEGIN
INSERT
INTO XXORT_RETURNS_DISPOSITION(ORGANIZATION_CODE,ORDER_NUMBER,ITEM_NUMBER,LOT_NUMBER,QUANTITY_SCANNED,DISPOSITION_CODE,LINE_STATUS,CREATION_DATE,CREATED_BY,LAST_UPDATE_DATE,LAST_UPDATED_BY)
VALUES(p_orgCode,p_orderNum,p_item,p_lot,p_qty,p_subInv,p_status,p_createDate,p_createBy,p_updateDate,p_updateBy);

END XXORT_INSERT_DISPOSITION;

_____________________________
JAVA CODE AS FOLLOWS
------------------------------

oraclecallablestatement = (OracleCallableStatement)connection.prepareCall(sqlString);

oraclecallablestatement.clearParameters();
oraclecallablestatement.setMaxFieldSize(200);

oraclecallablestatement.setString(1, orgCode);
oraclecallablestatement.setString(2, orderNum);
oraclecallablestatement.setString(3, item);
oraclecallablestatement.setString(4, lot);
oraclecallablestatement.setDouble(5, qty);
oraclecallablestatement.setString(6, subInv);
oraclecallablestatement.setString(7, status);
oraclecallablestatement.setString(8, "SYSDATE");
oraclecallablestatement.setString(9, createBy);
oraclecallablestatement.setString(10, "SYSDATE");
oraclecallablestatement.setString(11, updateBy);


oraclecallablestatement.execute();
R Laksh
Greenhorn

Joined: Aug 27, 2003
Posts: 25
Can you please post wha tis the sqlString in the following statement?

oraclecallablestatement = (OracleCallableStatement)connection.prepareCall(sqlString);

Thanks
vikram nalagampalli
Ranch Hand

Joined: Oct 08, 2001
Posts: 91
sqlString = " begin ? := XXORT_INSERT_DISPOSITION (?,?,?,?,?,?,?,?,?,?,?); end;";
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2497
    
    8

Try Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
R Laksh
Greenhorn

Joined: Aug 27, 2003
Posts: 25
Hi Vikram,

Seems you are using the query string in oracle format.

You are not registering the out parameter. Thats the cause for the
exception thrown.

JanCampus has given the JDBC syntax.

See the following link
http://www.enterprisedt.com/publications/oracle/result_set.html

It may helpful

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ORA-01008: not all variables bound trying to call CallableStatement