Oracle9i Supplied PL/SQL Packages and Types Reference Release 1 (9.0.1) Part Number A89852-02 |
|
DBMS_LOB , 5 of 26
This procedure copies all, or a part of, a source internal LOB
to a destination internal LOB
. You can specify the offsets for both the source and destination LOBs
, and the number of bytes or characters to copy.
If the offset you specify in the destination LOB
is beyond the end of the data currently in this LOB
, then zero-byte fillers or spaces are inserted in the destination BLOB
or CLOB
respectively. If the offset is less than the current length of the destination LOB
, then existing data is overwritten.
It is not an error to specify an amount that exceeds the length of the data in the source LOB
. Thus, you can specify a large amount to copy from the source LOB
, which copies data from the src_offset
to the end of the source LOB
.
DBMS_LOB.COPY ( dest_lob IN OUT NOCOPY BLOB, src_lob IN BLOB, amount IN INTEGER, dest_offset IN INTEGER := 1, src_offset IN INTEGER := 1); DBMS_LOB.COPY ( dest_lob IN OUT NOCOPY CLOB CHARACTER SET ANY_CS, src_lob IN CLOB CHARACTER SET dest_lob%CHARSET, amount IN INTEGER, dest_offset IN INTEGER := 1, src_offset IN INTEGER := 1);
Exception | Description |
---|---|
VALUE_ERROR |
Any of the input parameters are |
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_3a IS lobd, lobs BLOB; dest_offset INTEGER := 1 src_offset INTEGER := 1 amt INTEGER := 3000; BEGIN SELECT b_col INTO lobd FROM lob_table WHERE key_value = 12 FOR UPDATE; SELECT b_col INTO lobs FROM lob_table WHERE key_value = 21; DBMS_LOB.COPY(lobd, lobs, amt, dest_offset, src_offset); COMMIT; EXCEPTION WHEN some_exception THEN handle_exception; END; CREATE OR REPLACE PROCEDURE Example_3b IS lobd, lobs BLOB; dest_offset INTEGER := 1 src_offset INTEGER := 1 amt INTEGER := 3000; BEGIN SELECT b_col INTO lobd FROM lob_table WHERE key_value = 12 FOR UPDATE; SELECT b_col INTO lobs FROM lob_table WHERE key_value = 12; DBMS_LOB.COPY(lobd, lobs, amt, dest_offset, src_offset); COMMIT; EXCEPTION WHEN some_exception THEN handle_exception; END;
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|