This week's book giveaway is in the NodeJS forum. We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line! See this thread for details.
I am trying to call an Oracle SQL function using java CallableStatement.
The application is giving me this error: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at line 1.
Here is the code:
Does anybody know what am I doing wrong?
posted 4 months ago
Input parameters are:
<Return Value> Elinktypes.ref_collection OUT N/A -- this is what the function is reurning it is a cursor value type
P_CODMARKET VARCHAR2(4) IN NULL
P_CODBRAND VARCHAR2(2) IN NULL
P_CODMODEL VARCHAR2(3) IN NULL
P_CODVERSION VARCHAR2(3) IN NULL
P_CODSERIE VARCHAR2(1) IN NULL
P_CODSPECIALSERIE VARCHAR2(3) IN NULL
P_CODUPHOLSTERY VARCHAR2(3) IN NULL
P_CODLANGUAGE VARCHAR2(5) IN NULL
P_CODBILLCATEGORY VARCHAR2(2) IN NULL
P_ENVIRONMENT CHAR(200) IN NULL
The Class.forName statement is obsolete. JDBC drivers have been able to register themselves without it for a long time now.
The actual error message is what I'd expect to see if your stored procedure was expecting one or more parameters defined as numeric, considering that you're setting all their values using setString().
I know that this is a stored procedure and therefore inherently non-portable, but it always pains me to see lots of vendor-specific code in an application. Avoid it if you can. Amazon is totally dumping Oracle and your code would require a total rewrite there. Generic JDBC code would require little or no rewriting.
When it comes to destroying a civilization, gas chambers cannot hold a candle to echo chambers.
posted 4 months ago
I'd say there's an issue with your set up if the getObject and cast doesn't work.
That error really isn't from the cast.
You also should not have to use the Oracle stuff directly.
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
global solutions you can do at home or in your backyard