49.11 NEXT_CHUNK Function
This function reads a fixed-length string from a clob. This is just a small wrapper around DBMS_LOB.READ
, however it prevents common errors when incrementing the offset and picking the maximum chunk size.
Syntax
FUNCTION NEXT_CHUNK (
p_str IN CLOB,
p_chunk OUT NOCOPY VARCHAR2,
p_offset IN OUT NOCOPY PLS_INTEGER,
p_amount IN PLS_INTEGER DEFAULT 8191 )
RETURN BOOLEAN;
Parameters
Table 49-11 NEXT_CHUNK Function Parameters
Parameters | Description |
---|---|
|
The input clob. |
|
The chunk value (in/out). |
|
The position in |
|
The amount of characters that should be read (default 8191). |
Returns
True
if another chunk could be read. False
if reading past the end of p_str
.
Example
Print chunks of 25 bytes of the input clob.
declare
l_input clob := 'The quick brown fox jumps over the lazy dog';
l_offset pls_integer;
l_chunk varchar2(20);
begin
while apex_string.next_chunk (
p_str => l_input,
p_chunk => l_chunk,
p_offset => l_offset,
p_amount => 20 )
loop
sys.dbms_output.put_line(l_chunk);
end loop;
end;
Output:
The quick brown fox
jumps over the lazy
dog
Parent topic: APEX_STRING