Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> How to replace current Clob data with new Data using jdbc
I was wondering if anyone had some hints on how to replace all the data in a
Clob_column with new data, all through jdbc?
The way I'm doing it now is to execute a statement like "update TABLE_A set CLOB_COL=empty_clob() where id=2;". Following this statement I execute my code below:
ResultSet rs = stmt.executeQuery("select CLOB_COL from TABLE_A where ID=2 for update");
if (rs.next()) { Clob clob = rs.getClob(1); Writer writer = ((oracle.sql.CLOB)clob).getCharacterOutputStream(); writer.write( info ); writer.flush(); writer.close(); }
Is there a way to get an empty_clob without executing a statement? Or a method for zeroing out all the data in a Clob, but still able to hold on to the same clob locator to enter new data?
-John Received on Tue Jun 11 2002 - 16:55:05 CDT