Library /sys$common/syshlp/HELPLIB.HLB  —  SQLMOD72  SQLMOD Command Line, Arguments  QUERY_ESTIMATES
    Syntax options:

       QUERY_ESTIMATES
       NOQUERY_ESTIMATES

    Specifies whether or not SQL returns the estimated number of
    rows and estimated number of disk I/O operations in the SQLCA
    structure. If you specify the default, which is the QUERY_
    ESTIMATES qualifier, SQL returns the estimated number of rows
    in the field SQLCA.SQLERRD[2] and the estimated number of disk
    I/O operations in the field SQLCA.SQLERRD[3]. The value of
    SQLCA.SQLERRD[2] and SQLCA.SQLERRD[3] is normally 0 after you
    execute an OPEN statement for a table.

    The following example shows interactive SQL output from a
    statement that accesses the INTRO_PERSONNEL database. The
    database was loaded using the sample program SQL$INTRO_LOAD_
    EMPL_C.SQLMOD with the QUERY_ESTIMATES qualifier on the module
    language command line. The SQLCA.SQLERRD[2] field shows that SQL
    estimates 100 rows. The SQLCA.SQLERRD[3] field shows that SQL
    estimates 16 disk I/O operations.

    $ SQL$
    SQL> ATTACH 'FILENAME intro_personnel';
    SQL> DECLARE MY_CURSOR
    cont> TABLE CURSOR FOR
    cont> SELECT * FROM EMPLOYEES;
    SQL> OPEN MY_CURSOR;
    SQL> SHOW SQLCA;
    SQLCA:
            SQLCAID:        SQLCA           SQLCABC:        128
            SQLCODE:        0
            SQLERRD:        [0]: 0
                            [1]: 0
                            [2]: 100
                            [3]: 16
                            [4]: 0
                            [5]: 0
            SQLWARN0:               SQLWARN1:               SQLWARN2:
            SQLWARN3:               SQLWARN4:               SQLWARN5:
            SQLWARN6:               SQLWARN7:
Close Help