-
numeric overflow error
my procedure has a big number as a output parameter
i am registering it using the Types.Integer.
But i am getting a numberic overflow error.
i think the out parameter returned by the procedure is too big for the
Types.Integer !
i am also calling registerOutParameter( ) for this.
dont exactly remeber whther i am using getInteger !
is the fix needed on the database or on java side ?
thanks
niranjan !
edit by admin, please do not post contact info on the forum, thank you
-
whats a big number?
you are making absolutely no sense here, post an example.
Doesnt even sound like database stuff you are using here
-
Looks like you are using PL/SQL procedure with Java. Since the error message talks of OVERFLOW, how about changing Types.Integer to some higher datatypes like Types.BIGINT or Types.DOUBLE depending on your need?
-- Dilip
-
query.append("CALL OPP_DIRDEBS.SET_DEBIT_STATUS(?,?,?,?)");
statement = connection.prepareCall(query.toString());
statement.setLong(1, directDebitKey.getKey().longValue());
statement.setInt(2, status.getCode());
statement.setString(3, userContext.getUser().getUserName());
statement.registerOutParameter(4, Types.INTEGER);
statement.executeQuery();
System.out.println("after procedure call @@@@@@@@@" + statement.getLong(4));
return new Long(statement.getLong(4));
-
none of that is usefull - do a clear concise example with full errors
-
please help on this..
query.append("CALL some_procedure_name(?,?,?,?)");
statement = connection.prepareCall(query.toString());
statement.setLong(1, directDebitKey.getKey().longValue());
statement.setInt(2, status.getCode());
statement.setString(3, userContext.getUser().getUserName());
statement.registerOutParameter(4, Types.INTEGER); //this gives numeric overflow
statement.executeQuery();
System.out.println("after procedure call @@@@@@@@@" + statement.getLong(4));
return new Long(statement.getLong(4));
please see the comments in the code..
the related log is -
Fri Mar 02 10:38:03 CET 2007,com.abnamro.opp.bm.payment.directdebit.DataAccessClass.java,java.sql.SQLException: Numeric Overflow
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java(Inlined Compiled Code))
at oracle.jdbc.driver.NumberCommonAccessor.getLong(NumberCommonAccessor.java(Compiled Code))
at oracle.jdbc.driver.OracleCallableStatement.getLong(OracleCallableStatement.java:1155)
at com.ibm.ws.rsadapter.jdbc.WSJdbcCallableStatement.getLong(WSJdbcCallableStatement.java:409)
at com.abnamro.opp.util.jdbc.wrapper.CallableStatementWrapper.getLong(CallableStatementWrapper.java:256 )
at com.abnamro.opp.bm.payment.directdebit.DataAccessClass.methodThatCallsProcedure(DataAccessClass.java .java:838)
at com.abnamro.opp.bm.payment.directdebit.DirectDebitPaymentDataAccess.methodThatCallsProcedure(DataAcc essClass.java465)
at com.abnamro.opp.bm.payment.directdebit.DirectDebitPaymentDataAccess.storeDirectDebitPayment(DataAcce ssClass.java.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
-
 Originally Posted by cogni_niru
statement.setString(3, userContext.getUser().getUserName());
statement.registerOutParameter(4, Types.INTEGER); //this gives numeric overflow
How about changing that to Types.BIGINT. Did you try that?
-- Dilip
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|