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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to shrink a BLOB in Java/JDBC?

Re: How to shrink a BLOB in Java/JDBC?

From: Brian Jay Gould <bgould_at_home.com>
Date: Thu, 05 Aug 1999 02:16:31 GMT
Message-ID: <3u6q3.84650$eF3.27318@news.rdc1.nj.home.com>


Thank you very much.

Thomas Kyte <tkyte_at_us.oracle.com> wrote in message news:37aa5430.7461088_at_newshost.us.oracle.com...
| A copy of this was sent to "Brian Jay Gould" <bgould_at_home.com>
| (if that email address didn't require changing)
| On Wed, 04 Aug 1999 02:25:18 GMT, you wrote:
|
| >I can see how to write to a BLOB from a Java/JDBC application or stored procedure, but it isn't
at
| >all clear if it is possible to truncate a BLOB.
| >
| >In my case, I am writing an array of values and I often find it necessary to append to the end of
| >the array. No problem. Sometimes, I need to remove some of the values from the end of the
array.
| >Naturally, I can use some kind of length indicator inside the BLOB and simply ignore everything
| >after a point, but I was hoping to use the BLOB.length() method to determine how many values are
in
| >the array without actually reading it.
| >
| >Is there any way to do this besides re-writing an entirely new BLOB?
| >
|
|
| call the DBMS_LOB.TRIM() Procedure..
|
| You can call the TRIM() procedure to trim the value of the internal LOB to the
| length you specify in the newlen parameter. Specify the length in bytes for
| BLOBs, and in characters for CLOBs.
|
|
| If you attempt to TRIM() an empty LOB, nothing occurs, and TRIM() returns
| no error. If the new length that you specify in newlen is greater than the size
| of the LOB, an exception is raised.
|
| --
| See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
| Current article is "Part I of V, Autonomous Transactions" updated June 21'st
|
| Thomas Kyte tkyte_at_us.oracle.com
| Oracle Service Industries Reston, VA USA
|
| Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Wed Aug 04 1999 - 21:16:31 CDT

Original text of this message

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