SHARE
TWEET

Untitled

a guest Jun 18th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top