Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. Clob myClob = CLOB.createTemporary(sql.getConnection(), false, CLOB.DURATION_SESSION);
  2. while ((row = reader.readNext()) != null) {
  3.  
  4. myClob.truncate(0)
  5. myClob.setString(1,row[17])
  6.  
  7. def stmt = /
  8. MERGE INTO my_table a
  9. USING (
  10. SELECT ${row[0]} id,
  11. ${myClob} clob_column
  12. FROM dual) e
  13. ON (a.id = e.id)
  14. WHEN MATCHED THEN
  15. UPDATE SET
  16. a.clob_column = e.clob_column
  17.  
  18. /
  19.  
  20. def runsql = sql.execute(stmt)
  21.  
  22. ${myClob ?: null}
  23.  
  24. ${if(myClob.length() > 0) then myClob else null}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement