Oracle9i Supplied PL/SQL Packages and Types Reference Release 1 (9.0.1) Part Number A89852-02 |
|
DBMS_LOB , 26 of 26
This procedure writes a specified amount of data to the end of an internal LOB
. The data is written from the buffer
parameter.
There is an error if the input amount is more than the data in the buffer. If the input amount is less than the data in the buffer, then only amount bytes or characters from the buffer are written to the end of the LOB
.
DBMS_LOB.WRITEAPPEND ( lob_loc IN OUT NOCOPY BLOB, amount IN BINARY_INTEGER, buffer IN RAW); DBMS_LOB.WRITEAPPEND ( lob_loc IN OUT NOCOPY CLOB CHARACTER SET ANY_CS, amount IN BINARY_INTEGER, buffer IN VARCHAR2 CHARACTER SET lob_loc%CHARSET);
Exception | Description |
---|---|
VALUE_ERROR |
Any of |
INVALID_ARGVAL |
- |
The form of the VARCHAR2
buffer must match the form of the CLOB
parameter. In other words, if the input LOB
parameter is of type NCLOB
, then the buffer must contain NCHAR
data. Conversely, if the input LOB
parameter is of type CLOB
, then the buffer must contain CHAR
data.
When calling DBMS_LOB
.WRITEAPPEND
from the client (for example, in a BEGIN
/END
block from within SQL*Plus), the buffer must contain data in the client's character set. Oracle converts the client-side buffer to the server's character set before it writes the buffer data to the LOB
.
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_17 IS lob_loc BLOB; buffer RAW; amt BINARY_INTEGER := 32767; i INTEGER; BEGIN SELECT b_col INTO lob_loc FROM lob_table WHERE key_value = 12 FOR UPDATE; FOR i IN 1..3 LOOP -- fill the buffer with data to be written to the lob dbms_lob.writeappend (lob_loc, amt, buffer); END LOOP; END;
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|