Skip Headers

Oracle® OLAP DML Reference
10g Release 1 (10.1)

Part Number B10339-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

EXTBYTES

The EXTBYTES function extracts a portion of a text expression.

Return Value

TEXT

Syntax

EXTBYTES(text-expression [start [length]])

Arguments

text-expression

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.

start

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.

length

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


Single-Byte Characters

When you are using a single-byte character set, you can use the EXTCHARS function instead of the EXTBYTES function.


NTEXT Data Type

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