Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How to replace current Clob data with new Data using jdbc

How to replace current Clob data with new Data using jdbc

From: J. Harris <John.Harris_at_nurs.utah.edu>
Date: Tue, 11 Jun 2002 15:55:05 -0600
Message-ID: <ae5rk6$bln$1@coward.ks.cc.utah.edu>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US