SQL_BLOB_TAG_GET outputs the current value of an attribute of an existing BLOB. The input parameters include the REF value of the BLOB, the database name and the name of the attribute (tag). Possible tags include CREATED, UPDATED, MIME and USAGE. In addition, you must define a buffer into which the attribute value will be written, and specify its length. If the BLOB has no attribute with the specified tag, an error message is output.
This CLI call requires the SELECT privilege for the BLOB table.
CLI declaration in C:
void SQL_BLOB_TAG_GET( char const *REFvalue ,char const *CatalogId ,char const *TagName ,char *Buffer ,long int const *BufferLength ,long int *ValueLength ,struct SQLda_t *SQLda);
CLI-Deklaration in COBOL:
IDENTIFICATION DIVISION. PROGRAM-ID. SQLbtge IS PROTOTYPE. DATA DIVISION. LINKAGE SECTION. 01 REFvalue PIC X(237). 01 CatalogId PIC X(31). 01 TagName PIC X(31). 01 Buffer. *> of any length 02 PIC X(1). 01 BufferLength PIC S9(9) COMP. 01 ValueLength PIC S9(9) COMP. COPY SQLCA. *> for group item SQLda. PROCEDURE DIVISION USING REFvalue, CatalogId, TagName, Buffer, BufferLength, ValueLength, SQLda. END PROGRAM SQLbtge.
REFvalue
The REF value of the BLOB. The exact structure of REF values is described on "Column definitions".
CatalogId
Unqualified name of the database in which the table is located. 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.
TagName
Name of the attribute (tag). If necessary, this name must be padded with blanks up to a length of 31 characters or terminated with a null byte. TagName
may not be a blank string.
Buffer
Buffer to which the attribute value is to be written.
BufferLength
Length of the buffer in bytes. BufferLength
must be a number >= 0. If the buffer length is less than that of the attribute value with trailing blanks removed, the buffer is filled up as far as its length permits. A message is output in this case.
ValueLength
Length of the attribute value read in bytes. If the length of the attribute value is greater than the value specified in BufferLength
, only part of the attribute value will be transferred to the buffer.
SQLda
Diagnostics area.