LOB locator variables
A LOB locator variable is a host variable that contains the locator representing a LOB value on the database server.
See Manipulating LOBs using locators for information about how locators can be used to manipulate LOB values.
static volatile SQL TYPE IS CLOB_LOCATOR *loc1;
The term locator-variable, as used in the syntax diagrams, shows a reference to a LOB locator variable. The meta-variable locator-variable can be expanded to include a host-identifier the same as that for host-variable.
Like all other host variables, a LOB locator variable can have an associated indicator variable. Indicator variables for LOB locator variables behave in the same way as indicator variables for other data types. When a null value is returned from the database, the indicator variable is set and the locator host variable is unchanged. This means a locator can never represent a null value. However, when the indicator variable associated with a LOB locator is null, the value of the referenced LOB value is null.
If a locator variable does not currently represent any value, an error occurs when the locator variable is referenced.
When a transaction commits, LOB locators that were acquired by the transaction are released unless a HOLD LOCATOR statement was issued for the LOB locator. When the transaction ends, all LOB locators are released.
It is the application programmer's responsibility to guarantee that any LOB locator is used only in SQL statements that are executed at the same server that originally generated the LOB locator. For example, assume that a LOB locator is returned from one server and assigned to a LOB locator variable. If that LOB locator variable is subsequently used in an SQL statement that is executed at a different server unpredictable results will occur.