truncate lob

Description

Truncates a LOB to a specified length.

Syntax

truncate lob locator_descriptor [ ( result_length)]

Parameters

locator_descriptor

is a valid locator: a host variable, a local variable, or the literal binary value of a locator.

result_length

is a length, in characters, for text and unitext locators, and in bytes for image locators.

Examples

Example 1

Truncates the LOB referenced by text locator @w to 20 characters:

truncate lob @w (20)

Usage

If result_length is not specified or is 0 (zero), Adaptive Server deallocates the LOB memory, and points the locator to a null LOB.

Permissions

Any user can execute truncate lob.

See also

Commands deallocate locator

Transact-SQL functions locator_valid, return_lob, create_locator