Oracle® OLAP DML Reference 10g Release 1 (10.1) Part Number B10339-02 |
|
|
View PDF |
The EXTBYTES function extracts a portion of a text expression.
Return Value
TEXT
Syntax
EXTBYTES(text-expression [start [length]])
Arguments
The expression from which a portion is to be extracted. When text-expression is a multiline TEXT value, EXTBYTES preserves the line breaks in the returned value.
An integer that represents the byte position at which to begin extracting. The position of the first byte in text-expression is 1. When you omit this argument, EXTBYTES starts with the first byte.
An integer that represents the number of bytes to be extracted. When length is not specified, or exceeds the number of bytes from start to the end of text-expression, the part from start to the end of text-expression is extracted.
Notes
When you are using a single-byte character set, you can use the EXTCHARS function instead of the EXTBYTES function.
This function does not accept NTEXT arguments, because it is oriented toward byte-manipulation instead of character manipulation. It always returns values of type TEXT. When you must use this function on NTEXT values, use the CONVERT or TO_CHAR function to convert the NTEXT value to TEXT.
Examples
Example 12-5 Extracting Text Characters Using Bytes
This example shows how to extract portions of text from the TEXT value 'hellotherejoe'
.
The statement
SHOW EXTBYTES('hellotherejoe', 6, 5)
produces the following output.
there
The statement
SHOW EXTBYTES('hellotherejoe', 11)
produces the following output.
joe