return_lob

Description

Dereferences a locator, and returns the LOB referenced by that locator.

Syntax

return_lob (datatype, locator_descriptor)

Parameters

datatype

is the datatype of the LOB. Valid datatypes are:

  • text

  • unitext

  • image

locator_descriptor

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

Examples

Example 1

This example dereferences the locator and returns the LOB referenced by the literal locator value 0x9067ef4501000000001000000040100400800000000.

return_lob (text, locator_literal(text_locator, 0x9067ef4501000000001000000040100400800000000))

Usage

return_lob overrides the set send_locator on command, and always returns a LOB.

Permissions

Any user can execute return_lob.

See also

Commands deallocate locator, truncate lob

Transact-SQL functions locator_literal, locator_valid, create_locator