Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Overview

The following SESAM CLI calls are available to users:

Operations involving BLOB classes

CLI call

Short form

Function

SQL_BLOB_CLS_REF

SQLbcre

Create and output class REF value

SQL_BLOB_CLS_ISBTAB

SQLbcis

Check whether BLOB table exists

Table 56: CLI calls for operations involving BLOB classes

Creating and deleting BLOBs

CLI call

Short form

Function

SQL_BLOB_OBJ_CLONE

SQLbocl

Create a clone of a BLOB

SQL_BLOB_OBJ_CREATE

SQLbocr

Create a BLOB (object number sequential)

SQL_BLOB_OBJ_CREAT2

SQLboc2

Create a BLOB (object number area-specific)

SQL_BLOB_OBJ_DROP

SQLbodr

Delete a BLOB

Table 57: CLI calls for BLOB objects

Reading and setting BLOB attributes

CLI call

Short form

Function

SQL_BLOB_TAG_GET

SQLbtge

Read an attribute value

SQL_BLOB_TAG_PUT

SQLbtpu

Set an attribute value

Table 58: CLI calls for BLOB attributes

Reading and setting BLOB values

CLI call

Short form

Function

SQL_BLOB_VAL_GET

SQLbvge

Output BLOB value

SQL_BLOB_VAL_PUT

SQLbvpu

Set BLOB value

SQL_BLOB_VAL_LEN

SQLbvle

Output the length of a BLOB value

Table 59: CLI calls for BLOB values

Sequential processing of BLOB values

CLI call

Short form

Function

SQL_BLOB_VAL_OPEN

SQLbvop

Open an access handle

SQL_BLOB_VAL_CLOSE

SQLbvcl

Close an access handle

SQL_BLOB_VAL_FETCH

SQLbvfe

Read a BLOB value sequentially

SQL_BLOB_VAL_STOW

SQLbvst

Set a BLOB value sequentially

Table 60: CLI call for individual sequences of BLOB values

Defining attribute values for dynamic INSERT statements

CLI call

Short form

Function

SQL_DIAG_SEQ_GET

SQLdsg

The RETURN INTO function of static INSERT
statements is made available for dynamic INSERT
statements

Table 61: CLI call for defining attribute values for dynamic INSERT statements

Example

A demonstration program for processing BLOB values by means of SESAM-CLI
can be found in the library SIPANY.SESAM-SQL.090.MAN-DB. This is an ESQL-
COBOL program from which C functions for executing CLI calls can be launched.

Below, we outline the steps required to create a BLOB object.

  1. The REF value ref_value is output for the BLOB object class to which the new
    BLOB object is to belong. The BLOB object is to be located in the table named
    table in the schema named schema.

    SQL_BLOB_CLS_REF(table, schema, ref_value, &SQLDA)

  2. The BLOB object is created by entering the REF value ref_value of the class and
    the name of the database catalog. The REF value ref_value of the new BLOB
    object is output.

    SQL_BLOB_OBJ_CREATE(ref_value, catalog, &SQLDA)

  3. An access handle for writing is opened with ForWriteAccess=1. The REF value
    ref_value of the BLOB object and the database name catalog are specified. The
    access handle is identified in the following by the return value access_handle.

    SQL_BLOB_VAL_OPEN (ref_value, catalog, 
                       (long int const *)&ForWriteAccess,
                       access_handle, &SQLDA)
    
  4. The BLOB value is set sequentially within the access handle. access_handle is
    specified to identify the access handle. This step is repeated until the entire
    BLOB value has been read from the buffer.

    SQL_BLOB_VAL_STOW(access_handle, input_buffer,
                      (long int const *)&n, &SQLDA)
  5. The access handle is closed. access_handle is specified to identify the access

    handle.

    SQL_BLOB_VAL_CLOSE (access_handle, &SQLDA)