Advertisement
Guest User

Untitled

a guest
Jul 28th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. PROCEDURE do_stuff (
  2. i_userid IN NUMBER,
  3. inlist IN detail_list
  4. outlist OUT detail_list,
  5. i_debugmode IN NUMBER := 0)
  6.  
  7.  
  8. create or replace
  9. TYPE detail_list AS TABLE OF detail
  10.  
  11.  
  12. create or replace
  13. TYPE detail AS OBJECT (
  14. field1 NUMBER (9),
  15. field2 NUMBER (9),
  16. field3 NUMBER (9),
  17. field4 NUMBER (1)
  18. )
  19.  
  20. //populate list<myObject> into list myList.
  21. SimpleJdbcCall call = new SimpleJdbcCall(jdbcTemplate).withProcedureName("do_stuff").withCatalogName("catalogname");
  22. final MapSqlParameterSource params = new MapSqlParameterSource();
  23. params.addValue("i_userid", userID);
  24. params.addValue("inlist", myList);
  25. params.addValue("i_debug_mode", 0);
  26.  
  27. Map<String, Object> results = call.execute(params);
  28. LOGGER.debug("About to execute the query. I hope this works");
  29. List<myObject> myList = (List<myObject>)results.get("outlist");
  30. chargeDetailsList = myList;
  31.  
  32. public class myObject {
  33. private long field1;
  34. private long field2;
  35. private long field3;
  36. private long field4;
  37. //getters and setters....
  38. }
  39.  
  40. org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback;
  41. uncategorized SQLException for SQL [{call do_stuff(?, ?, ?, ?)}]; SQL state [99999]; error code [17004];
  42. Invalid column type; nested exception is java.sql.SQLException: Invalid column type
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement