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

MAXBYTES

The MAXBYTES function counts the number of bytes in the longest line of a multiline text expression. The result returned by MAXBYTES has the same dimensions as the specified expression.

Return Value

INTEGER

Syntax

MAXBYTES(text-expression)

Arguments

text-expression

The text expression whose bytes for each line are to be counted.

Notes


Single-Byte Characters

When you are using a single-byte character set, you can use the MAXCHARS function instead of the MAXBYTES 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 17-1 Finding the Length of the Longest Line Using Bytes

You would like to know the length of the longest line in a text variable called mytext. The following example shows the value of the variable and the result returned by MAXBYTES.

The statement

SHOW mytext

produces the following output.

This is a multiline text variable. 
The longest line is this one in the middle.
The third line is short.

The statement

SHOW MAXBYTES(mytext)

produces the following output.

43