Use the create_locator function to explicitly create a locator.
To create a locator for a text LOB, enter:
select create_locator(text_locator, convert(text, "some_text_value"))
To create a locator for an image LOB, enter:
select create_locator(image_locator, image_col) from table_name
For example, to create a locator for an image LOB stored in the image_column column of my_table, enter:
select create_locator(image_locator, image_column) from my_table where id=7
Both examples create and return a LOB locator that references a LOB value stored in Adaptive Server memory.
When explicitly creating a locator, Adaptive Server always sends a locator, regardless of the value of send_locator.
Using a select statement to create a locator is most useful when the client application stores the received locator for use in subsequent Transact-SQL statements. In an isql session, the locator is assigned to a local variable. For example:
declare @v text_locator select @v = create_locator(text_locator, textcol) from my_table where id = 10
You can also create a locator that references an empty LOB.