Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table data (
- id VARCHAR2(255),
- key VARCHAR2(255),
- value CLOB);
- merge into data
- using (
- select
- ? id,
- ? key,
- ? value
- from
- dual
- ) val on (
- data.id=val.id
- and data.key=val.key
- )
- when matched then
- update set data.value = val.value
- when not matched then
- insert (id, key, value) values (val.id, val.key, val.value);
- ORA-01461: cannot bind a LONG value for insert into a long column
- CLOB tempClob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
- // Open the temporary CLOB in readwrite mode to enable writing
- tempClob.open(CLOB.MODE_READWRITE);
- // Get the output stream to write
- Writer tempClobWriter = tempClob.getCharacterOutputStream();
- // Write the data into the temporary CLOB
- tempClobWriter.write(stringData);
- // Flush and close the stream
- tempClobWriter.flush();
- tempClobWriter.close();
- // Close the temporary CLOB
- tempClob.close();
- myStatement.setCLOB(column.order, tempClob);
Add Comment
Please, Sign In to add comment