Product Documentation

c-treeRTG V2 Update Guide

Previous Topic

Next Topic

Right-justified strings (JustAN field type) mapped to SQL

The COBOL-to-SQL type mapping did not support JustAN (right-justified strings) COBOL types. JustAN types are now supported by mapping them into VARCHAR field types.

This mapping best mimics the behavior of these fields in COBOL. In particular, varchar is the only SQL type that considers trailing spaces as significant.

Due to the nature of JustAN types, left-side spaces are considered padding. On reading from the COBOL buffer, they are trimmed so they do not appear in SQL, where they would be significant data.

Previous Topic

Next Topic

Variable-length fields mapped into LONGVAR* SQL field

Variable length fields map into SQL LONGVAR* fields.

The XDD structure allows the following elements and attributes for variable length field support.

  1. dbtype values:
    • BLOB: Indicates a variable-length binary object with length depending on a field value.
    • CLOB: Indicates a variable-length text object with length depending on a field value.
  2. <field> attribute sizefield used in conjunction with dbtype BLOB or CLOB and having size = "0"

For an XDD field mapped into a LONG VARCHAR or LONG VARBINARY, the following conditions must be met:

  1. The field definition must have:

    size="0"

    sizefield="X" where "X" is a valid field containing the number of bytes (we suggest this field to be hidden, but this is not mandatory)

    dbtype="clob" or dbtype="blob"

  2. At maximum, one and only one field mapped to a BLOB or CLOB type.
  3. It must be the last field in the record buffer.

If one (or more) of the above condition is not met, error CTDBRET_CALLBACK_11 ("Unsupported clob/blob definition") is returned.

TOCIndex