Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
vikram nalagampalli
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please post wha tis the sqlString in the following statement?

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

Thanks
 
vikram nalagampalli
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sqlString = " begin ? := XXORT_INSERT_DISPOSITION (?,?,?,?,?,?,?,?,?,?,?); end;";
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try Regards, Jan
 
R Laksh
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic