Hi
I have a problem about JDBC (CallableStatement ) , I'd appreciate any
feedback. it happens thru in Castor JDO tooo.
while calling Oracle Store Procedure or function thru
JDBC Which takes a 1 IN Parameter of Type Char(1),
////Oracle Functions
FUNCTION sp__test (
-- commnets test_type is CHAR (1)
test IN EMPTable.test_type%TYPE )
)
RETURN NUMBER IS
pkg_application.sp__test(?)
Java code
we are setting as
CallableStatement cstmt= null;
String sql = "{? = call pkg_application.sp__test (?)}";
cstmt = connection.prepareCall( sql );
cstmt.registerOutParameter( 1, java.sql.Types.VARCHAR );
cstmt.setString(2,"I");
cstmt.execute();
ITS Work Fine //[HARD CODED]
Due to i am setting as
***** cstmt.setString(2,"I");
if i do
String str = "I";
String sql = "{? = call pkg_application.sp__test (?)}";
cstmt = connection.prepareCall( sql );cstmt.registerOutParameter( 1,
java.sql.Types.VARCHAR );
cstmt.setString(2,str);
cstmt.execute();
It fails in Store Procedure.
Error is
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Please let me know how to set a Char in Oracle Procedures .There is any
Equivalent API Function to Set Character.
Or we need to Change the Store Procedure.
Thanks & Regards
Sridhar
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev