VMS Help  —  SQLMOD72  Arguments  record-type
    You can pass records and indicator arrays to SQL module language
    procedures using the record-type clause.

    You can also pass records and indicator arrays to SQL module
    language procedures and retrieve data dictionary record
    declarations using the record-type clause.

    If a record reference has an indicator, it must be an indicator
    array. Specify the INDICATOR ARRAY OF clause instead of an item
    name or path name.

    The following example shows the use of record structures and
    indicator arrays in an SQL module language program. Because
    parameters in the module are preceded by colons, you must include
    the PARAMETER COLONS clause in the module header.

    MODULE          employee_module
    LANGUAGE        pascal
    AUTHORIZATION   pers
    PARAMETER COLONS

    DECLARE pers ALIAS FOR FILENAME mf_personnel

    DECLARE WORK_STATUS_CURSOR CURSOR FOR
        SELECT *
        FROM   PERS.WORK_STATUS

    PROCEDURE OPEN_WORK_STATUS
        SQLCODE;

        OPEN WORK_STATUS_CURSOR;

    PROCEDURE CLOSE_WORK_STATUS
        SQLCODE;

        CLOSE WORK_STATUS_CURSOR;

    PROCEDURE FETCH_EMPS_TO_DEPS_CURSOR
        SQLCODE,
        :work_status_rec
            record
            status_code PERS.work_status.STATUS_CODE_DOM
            status_name PERS.work_status.STATUS_NAME_DOM
            status_type PERS.work_status.STATUS_DESC_DOM
            end record
        :ind_array
            record
            indicator array of 3 SMALLINT
            end record
        ;
        FETCH WORK_STATUS_CURSOR
        INTO :work_status_rec INDICATOR :ind_array;
Close Help