LOB variables

Regular LOB variables (CLOB, DBCLOB, and BLOB), LOB locator variables and LOB file reference variables can be defined in all host languages with a few exceptions.

  • Java™ supports file reference variables, but not locators for LOBs.

Where LOBs are allowed, the term meta-variable variable in a syntax diagram can refer to a regular variable, a locator variable, or a file reference variable. Because these variables are not native data types in host programming languages, SQL extensions are used, and the precompilers generate the host language constructs that are necessary to represent each variable.

When it is possible to define a variable that is large enough to hold an entire LOB value and the performance benefit of delaying the transfer of data from the server is not required, a LOB locator or LOB file reference is not needed. However, it is often not acceptable to store an entire LOB value in temporary storage due to host language restrictions, storage restrictions, or performance requirements. When storing an entire LOB value at one time is not acceptable, you can use one of the following alternatives:

  • Referencing the LOB value using a LOB locator, and accessing portions of the value
  • Storing the entire LOB value in a file, and using a LOB file reference to access the data