Declaration of large object type host variables in FORTRAN embedded SQL applications

Large object (LOB) host variables that you declare in your embedded FORTRAN application are treated as if they were declared in a FORTRAN program. Host variables allow you to exchange data between the embedded application and the database manager.

The syntax for declaring large object (LOB) host variables in FORTRAN is:

Read syntax diagramSkip visual syntax diagramSQL TYPE IS BLOBCLOB (lengthKMG) ,variable-name
LOB host variable considerations:
  1. GRAPHIC types are not supported in FORTRAN.
  2. SQL TYPE IS, BLOB, CLOB, K, M, G can be in either uppercase, lowercase, or mixed.
  3. For BLOB and CLOB 1 <= lob-length <= 2 147 483 647.
  4. The initialization of a LOB within a LOB declaration is not permitted.
  5. The host variable name prefixes 'length' and 'data' in the precompiler generated code.

BLOB example:

Declaring:
   sql type is blob(2m) my_blob 
Results in the generation of the following structure:
    character    my_blob(2097152+4) 
    integer*4    my_blob_length 
    character    my_blob_data(2097152) 
    equivalence( my_blob(1), 
   +             my_blob_length ) 
    equivalence( my_blob(5), 
   +             my_blob_data ) 

CLOB example:

Declaring:
   sql type is clob(125m) my_clob 
Results in the generation of the following structure:
    character    my_clob(131072000+4) 
    integer*4    my_clob_length 
    character    my_clob_data(131072000) 
    equivalence( my_clob(1), 
   +             my_clob_length ) 
    equivalence( my_clob(5), 
   +             my_clob_data )