HELPLIB.HLB  —  SQLMOD72  Arguments  BY_DESCRIPTOR
    Specifies that the formal parameter will be passed to the calling
    program module by descriptor. The BY DESCRIPTOR clause is useful
    when:

    o  You specify the GENERAL keyword in the LANGUAGE clause of
       an SQL module, but the default for the language is to pass
       parameters by descriptor. The default for GENERAL is to pass
       parameters by reference, but you can override that default
       passing mechanism by specifying BY DESCRIPTOR.

    o  You want to take advantage of the CHECK option for parameter
       declarations. That option is available only for parameters
       declared with the BY DESCRIPTOR clause.

    o  You need to override the default parameter passing mechanism
       for languages that pass parameters by reference.

    The BY DESCRIPTOR clause supports only OpenVMS static
    descriptors, which are fixed-length fields.

    For any language, the passing mechanism for SQL module formal
    parameters must be the same as the actual parameters in the host
    language module.

    Ada, BASIC, C, FORTRAN, Pascal, and PL/I do not support passing
    records by descriptor. You may construct a descriptor from
    elements in all these languages and pass the constructed
    descriptor to the SQL module language by reference.

    o  When you construct a descriptor for a host language record
       when the module language is Ada, BASIC, C, FORTRAN, Pascal,
       PL/I, or GENERAL, use a fixed-length descriptor (CLASS_S)
       with a character string data type, and pass the length of the
       entire record.

    o  If the language is Ada, BASIC, FORTRAN, or Pascal, pass
       indicator arrays using an array descriptor (CLASS_A) and the
       data type of all of the array elements.

    o  If the language is COBOL, pass arrays using fixed-length
       (CLASS_S) descriptors and character string data types,
       regardless of the data types of the array elements.

    o  If the language is C, the SQL module processor interprets
       CHAR fields one way when the data type is defined in the
       module, and another way when the definition is read from
       the dictionary. When the data type is defined in the module,
       the SQL module processor interprets character strings within
       records as null-terminated strings. In other words, if you
       declare a field specified as CHAR(9), the C module language
       interprets this as a field that is actually 10 characters
       long, with the tenth character being the null terminator.

       However, if you include a record in a C module from the data
       dictionary, you can specify any of three options for CHAR
       field interpretation.
Close Help