Exception while Registering out parametes : Conflict: sqlType=12
Hi
I am getting the following exception when registering out parameter in a call to a pl/sql procedure from Java.
I am using OracleCallableStatement to call the PLSQL procedure.
I tried with both ? and :1 style of parameters
I tried to register the out parameters with both Types.VARCHAR and OracleTypes.VARCHAR
Code and Exception are below.
Did I miss anything ?
My Oracle Database Version is
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
Java Version is "1.5.0_24"
Any help will be greatly appreciated.
Thanks and Regards
Sameer
Exception while calling API ..
---------------------------------------
Parameter Type Conflict: sqlType=12
Stack Trace
-----------------
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:149)
oa_html._trexmptsconfigsave._jspService(_trexmptsconfigsave.java:261)
oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
oracle.jsp.JspServlet.internalService(JspServlet.java:186)
oracle.jsp.JspServlet.service(JspServlet.java:156)
javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
org.apache.jserv.JServConnection.run(JServConnection.java:294)
java.lang.Thread.run(Thread.java:619)
Code
-------
....
String plsqlCallStatement = "declare begin MY_QP_PRICE_CALC_PK.calculate_price( " +
" p_out_errbuf => :1 " +
" ,p_out_retcode => :2 " +
" ,p_transactional_curr_code => :3 " +
" ,p_order_type_id => :4 " +
" ,p_sold_to_org_id => :5 " +
" ,p_invoice_to_org_id => :6 " +
" ,p_ship_to_org_id => :7 " +
" ,p_price_list_id => :8 " +
" ,p_cust_po_number => :9 " +
" ,p_ship_from_org_id => :10 " +
" ,p_org_id => :11 " +
" ,p_freight_terms_code => :12 " +
" ,p_payment_term_id => :13 " +
" ,p_shipping_method_code => :14 " +
" ,p_config_hdr_id => :15 " +
" ,p_config_rev_nbr => :16 " +
" ,p_inventory_item_id => :17 " +
" ,p_request_date => :18 " +
" ,p_schedule_ship_date => :19 " +
" ,p_price_list => :20 " +
" ,p_list_price => :21 " +
" ,p_selling_price => :22 " +
" ,p_return_status => :23 " +
" ,p_return_status_text => :24 " +
" ); end; ";
appsInitializeStmt = (OracleCallableStatement)conn.prepareCall(plsqlCallStatement);
appsInitializeStmt.registerOutParameter(1, OracleTypes.VARCHAR, p_out_errbuf);
appsInitializeStmt.registerOutParameter(2, OracleTypes.NUMBER, p_out_retcode);
appsInitializeStmt.setString(3, currencyCode);
appsInitializeStmt.setInt(4, Integer.parseInt(orderTypeId));
appsInitializeStmt.setInt(5, Integer.parseInt(soldToOrgId));
appsInitializeStmt.setInt(6, Integer.parseInt(invoiceToOrgId));
appsInitializeStmt.setInt(7, Integer.parseInt(shipToOrgId));
appsInitializeStmt.setInt(8, Integer.parseInt(priceListId));
appsInitializeStmt.setString(9, customerPO);
appsInitializeStmt.setInt(10, Integer.parseInt(shipFromOrgId));
appsInitializeStmt.setInt(11, Integer.parseInt(ouId));
appsInitializeStmt.setString(12, "");
appsInitializeStmt.setInt(13, 0);
appsInitializeStmt.setString(14, "");
appsInitializeStmt.setInt(15, Integer.parseInt(cfgHdrId));
appsInitializeStmt.setInt(16, Integer.parseInt(cfgRevId));
appsInitializeStmt.setInt(17, 0);
appsInitializeStmt.setDate(18, null);
appsInitializeStmt.setDate(19, null);
appsInitializeStmt.registerOutParameter(20, OracleTypes.VARCHAR, p_price_list);
appsInitializeStmt.registerOutParameter(21, OracleTypes.NUMBER, p_list_price);
appsInitializeStmt.registerOutParameter(22, OracleTypes.NUMBER, p_selling_price);
appsInitializeStmt.registerOutParameter(23, OracleTypes.VARCHAR, p_return_status);
appsInitializeStmt.registerOutParameter(24, OracleTypes.VARCHAR, p_return_status_text);
appsInitializeStmt.execute();
p_price_list = appsInitializeStmt.getString(3);
p_list_price = appsInitializeStmt.getInt(4);
p_selling_price = appsInitializeStmt.getInt(5);
....