The WRITEAPPEND procedure writes a specified amount of data to the end of an internal LOB. The data is written from the buffer parameter.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_LOB.WRITEAPPEND (
lob_loc IN OUT NOCOPY BLOB,
amount IN INTEGER,
buffer IN RAW);
DBMS_LOB.WRITEAPPEND (
lob_loc IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,
amount IN INTEGER,
buffer IN VARCHAR2 CHARACTER SET ANY_CS);
Parameters
| Parameter | Description |
|---|---|
| lob_loc | The locator of the internal LOB to write to. For more information, see Use DBMS_LOB. |
| amount | The number of bytes to write (for a BLOB) or the number of characters to write (for a CLOB). |
| buffer | The input buffer to write from. |
Note
An error occurs if the input data exceeds the buffer size. If the input data is less than the buffer size, only the number of bytes or characters specified by the buffer is written to the end of the LOB.
Exceptions
| Exception | Description |
|---|---|
| VALUE_ERROR | The lob_loc, amount, or offset parameter is NULL, out of range, or invalid. |
| INVALID_ARGVAL | The following conditions are met:
|
| QUERY_WRITE | The LOB write operation cannot be performed in a query or in a parallel DML server. |
| BUFFERING_ENABLED | The LOB buffer is enabled. |
Considerations
The
VARCHARbuffer must match the format of theCLOBparameter. If the inputLOBparameter is of typeCLOB, the buffer must containCHARdata.When you call
DBMS_LOB.WRITEAPPENDfrom a client (for example, in anBEGIN/ENDblock in OBClient), the buffer must contain data in the client character set. Before writing the buffer data to theLOB, the database converts the client buffer to the server character set.You do not need to wrap
LOBoperations in an open/close interface. If theLOBis not open before the operation, the function index and domain index on theLOBcolumn are updated during the call. However, if theLOBis open before the operation, you must close it before committing the transaction. Closing the internalLOBupdates the function index and domain index on theLOBcolumn.If you do not wrap
LOBoperations in an open/close API, the function index and domain index are updated each time you write to theLOB. This can negatively impact performance. Therefore, we recommend that you includeLOBwrite operations in anOPENorCLOSEstatement.When you append data to a
LOB, theWRITEAPPENDprocedure retrieves theLOB.
