Transfer smart-large-object data

An INSERT or UPDATE statement does not perform the actual input of the smart-large-object data. It does, however, provide a means for the application to identify which smart-large-object data to associate with the column.

A BLOB or CLOB column in a database table stores the smart-large-object pointer structure for a smart large object. Therefore, when you store a BLOB or CLOB column, you provide a smart-large-object pointer structure for the column in a loptr variable to the INSERT or UPDATE statement.

The following figure shows how an application transfers the data of a smart large object to the database server.
Figure 1: Transfer smart-large-object data from client application to database server

This graphic illustrates the steps necessary for an application to transfer the data of a smart-large-object to the database server. The graphic is composed of two boxes arranges in a vertical line and connected by one arrow. The first box contains these two steps "1. Use client functions to create a smart-large-object pointer structure. 2. Initialize the smart-large-object data through the smart-large-object pointer structure: The second box contains this step: "Execute INSERT or UPDATE statement to assign the smart-large-object pointer structure to a CLOB or BLOB column.

The smart large object that a smart-large-object pointer structure identifies exists if the smart-large-object pointer structure exists. When you store a smart-large-object pointer structure in a database, the database server deallocates the smart large object when appropriate.

If your application does not store the smart-large-object pointer structure for a new smart large object in the database, the smart-large-object pointer structure is only valid to access the version of the smart large object that was current when the pointer was passed to the application. If the smart large object is updated later, the pointer is invalid. The smart-large-object pointer structures that you store in a row do not expire when the object version changes.

When you retrieve a row and then update a smart large object that is contained in that row, the database server exclusively locks the row for the time that it updates the smart large object. Moreover, long updates for smart large objects (whether logging is enabled and whether they are associated with a table row) create the potential for a long transaction condition if the smart large object takes a long time to update or create.

The smart-large-object pointer structure, not the CLOB or BLOB data itself, is stored in a CLOB or BLOB column in the database. Therefore, SQL statements such as INSERT and SELECT accept and return a smart-large-object pointer structure as the column value for a smart-large-object column.