Hi I am invoking an oracle stored procedure which takes an in out parameter. I am invoking the the procedure from my class which extends from spring's StoredProcedure class.Based on number of posts I have declared the inout parameter as out parameter in my class and also passed a value to the parameter in my mapping function. The problem is that it works only as a out parameter but not as in parameter.Can someone tell me what I might be doing wrong?
Code:public class MyService extends StoredProcedure { public MyService(JdbcTemplate jdbcTemplate,String sqlString) { setJdbcTemplate(jdbcTemplate); setSql(sqlString); setFunction(false); declareParameter( new SqlOutParameter("inoutparam",OracleTypes.INTEGER)); declareParameter( new SqlParameter("inparam",Types.VARCHAR)); compile(); } public Map execute(int arg1,String arg2) { Map<String, Object> inParams = new HashMap<String, Object>(); inParams.put("inoutparam", arg1); inParams.put("inparam", arg2); Map<String,Object> map = execute(inParams); return map; } }Code:PROCEDURE prc_my_proc ( inoutparam IN OUT NUMBER, inparam VARCHAR2) IS BEGIN INSERT INTO save_log values ( inoutparam,sysdate); inoutparam := 100; END prc_my_proc;


Reply With Quote
