Controlling Output When a TABLE Request Retrieves Zero Records

How to:

You can select the EMPTYREPORT command in the Set tool to control the output when a TABLE request retrieves zero records.

EMPTYREPORT is not supported with TABLEF or Excel. When a TABLEF or Excel request retrieves zero records, an empty report is generated.

Note: Using the IF TOTAL or WHERE TOTAL phrases when EMPTYREPORT is set to OFF may produce an empty report if there is no data that satisfies the TOTAL condition. This occurs because the test for report lines for EMPTYREPORT is applied before the TOTAL condition is applied.


Top of page

x
Procedure: How to Control the Output When a TABLE Request Retrieves Zero Records
  1. From the Procedure Viewer in Developer Studio, click and hold a component connector (yellow diamond), then select Set on the Component Connector toolbox.

    The Set tool opens.

  2. Select EMPTYREPORT from the Available Settings list and click Add.

    or

    Double-click EMPTYREPORT.

    EMPTYREPORT is added to the Used Settings list.

  3. Select a value from the Current Value list to set the EMPTYREPORT command.

    You may select from the following options:

    • ANSI. Produces a single-line report and displays the missing data character or a zero if a COUNT is requested. In each case, &RECORDS will be 0, and &LINES will be 1.

      If the SQL Translator is invoked, ANSI automatically replaces OFF as the default setting for EMPTYREPORT.

    • OFF. Produces no report output. OFF is the default value except for SQL Translator requests. ANSI replaces OFF as the default setting for the EMPTYREPORT parameter, so the results are the same as for the ANSI setting.
    • ON. Produces an empty report (column headings with no content). This was the default behavior in prior releases.

    The following image is an example of the EMPTYREPORT command in the Set tool.

  4. Click OK to save the SET EMPTYREPORT command and close the Set tool.

    The corresponding syntax is:

    SET EMPTYREPORT = {ANSI|OFF|ON}

WebFOCUS