The SESAM/SQL CLI call SQL_BLOB_OBJ_CLONE creates a clone of an already existing BLOB object in another database. The clone has the same REF value as the original BLOB object and is created in a BLOB table with the same schema name and table name as the original. The attributes of the clone are set according to the defaults of its BLOB table. The BLOB value has length 0.
This SQL_BLOB_OBJ_CLONE call can be used to replicate a BLOB table in another database. If this is done by repeating the SQL_BLOB_OBJ_CREATE call on the other database. Then the REF values for original and copied objects are different, so that the references in the two databases are different. The SQL_BLOB_OBJ_CLONE call allows the creation of a clone with the same REF value as the original object, so that references in the two databases remain the same.
The SQL_BLOB_OBJ_CLONE call can also be used to recreate a BLOB object that has been deleted erroneously.
CLI declaration in C:
#define SQL_BLOB_OBJ_CLONE SQLBOCL extern void SQL_BLOB_OBJ_CLONE( char const *REFvalue /* in */ ,char const *CatalogId /* in */ ,SQLda_t *sqlda); /* out */
IDENTIFICATION DIVISION. PROGRAM-ID. SQLbocl IS PROTOTYPE. DATA DIVISION. LINKAGE SECTION. 01 REFvalue PIC X(237). 01 CatalogId PIC X(31). COPY SQLCA. PROCEDURE DIVISION USING REFvalue, CatalogId, SQLda. END PROGRAM SQLbocl.
REFValue
The entered REFValue
must be a correct REF value, and must not refer to a class object. The BLOB table referenced by the REF value must exist in the given database. However, it must not contain the BLOB object related by the REF value. If the CLI call executes successfully, the returned REF value references a new BLOB object in the CatalogId
database. The BLOB value has the length 0. The CREATED and UPDATED attributes contain the same timestamp, and the other attributes are set to the default values of the BLOB table.
CatalogID
Unqualified name of the database with the new BLOB table. CatalogId
is an unqualified name (see section "Unqualified names"). If necessary, this name must be padded with blanks up to a length of 31 characters or terminated with a null byte. If you wish to use the default database name, simply enter a null byte or a string of blanks instead of the database name.