I have to call Oracle stored procedure from jdbc interface. Procedure takes a record type parameter which includes VARCHAR(2) field:
TYPE cust_account_rec_type IS RECORD (
... , status VARCHAR2(1), ... );
My jdbc query string declares record type variable and assigns value to status field, where right side is a query parameter. Then, calls procedure.
p_cust_account_rec.status := :IN_insert_status;
someprocedure(p_cust_account_rec);
Java query call sets the value for IN_insert_status parameter:
callableStatement.setString("IN_insert_status", "I");
// callableStatement is type of java.sql.CallableStatement
after callableStatement.execute() i got
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Message points to line with this single character varchar variable. However, when i hardcode value in sql query string as:
p_cust_account_rec.status := 'I';
it works.
What is the problem with passing single character string in java, or what am I missing?