-
Jan 26th, 2011, 07:02 AM
#1
Stored Procedure with JDBCTemplate cant get return value
I am using a sybase database with poorly written stored procedures that do not always define output variables and simple return an integer as a completion. I am using the SimpleJDBCCall to call stored procedures (I can successfully call other stored procedures that have input variables and output variables defined and all works) but when I attempt to call a procedure that doesn't have the output parameter defined I cannot get the value being returned and have tried many things.
An Example of what i have tried.
public void processSP_prna_chk_maf_archv(String mafMCN) {
//SimpleJdbcCall call = initiateOIMAStoredProcedure("prna_chk_maf_archv")
// .declareParameters(new SqlParameter("@prach_mcn", Types.VARCHAR));
// .execute(new MapSqlParameterSource().addValue("@prach_mcn", mafMCN));
SimpleJdbcCall call = new SimpleJdbcCall(getDataSource()).withFunctionName(" prna_chk_maf_archv");
call.addDeclaredParameter(new SqlParameter("@prach_mcn", Types.VARCHAR));
SqlParameterSource in = new MapSqlParameterSource().addValue("@prach_mcn", mafMCN);
Map<String,String> vals = new HashMap<String, String>();
vals.put("@prach_mcn",mafMCN);
Integer ret = call.executeFunction(Integer.class, vals);
System.out.println(ret);
How can i get this variable from the return of the stored proc?
Thanks
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