Oracle9i Supplied PL/SQL Packages and Types Reference Release 1 (9.0.1) Part Number A89852-02 |
|
DBMS_LOB , 24 of 26
This procedure trims the value of the internal LOB
to the length you specify in the newlen
parameter. Specify the length in bytes for BLOBs
, and specify the length in characters for CLOBs
.
If you attempt to TRIM
an empty LOB
, then nothing occurs, and TRIM
returns no error. If the new length that you specify in newlen
is greater than the size of the LOB
, then an exception is raised.
DBMS_LOB.TRIM ( lob_loc IN OUT NOCOPY BLOB, newlen IN INTEGER); DBMS_LOB.TRIM ( lob_loc IN OUT NOCOPY CLOB CHARACTER SET ANY_CS, newlen IN INTEGER);
Parameter | Description |
---|---|
lob_loc |
Locator for the internal |
newlen |
New, trimmed length of the |
Exception | Description |
---|---|
VALUE_ERROR |
|
INVALID_ARGVAL |
- |
It is not mandatory that you wrap the LOB operation inside the Open/Close APIs. If you did not open the LOB before performing the operation, the functional and domain indexes on the LOB column are updated during the call. However, if you opened the LOB before performing the operation, you must close it before you commit or rollback the transaction. When an internal LOB is closed, it updates the functional and domain indexes on the LOB column.
If you do not wrap the LOB operation inside the Open/Close API, the functional and domain indexes are updated each time you write to the LOB. This can adversely affect performance. Therefore, it is recommended that you enclose write operations to the LOB within the OPEN
or CLOSE
statement.
CREATE OR REPLACE PROCEDURE Example_15 IS lob_loc BLOB; BEGIN -- get the LOB locator SELECT b_col INTO lob_loc FROM lob_table WHERE key_value = 42 FOR UPDATE; dbms_lob.trim(lob_loc, 4000); COMMIT; END;
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|