Previous Topic Next topic Print topic


DISPLAY

This batch SQL command causes the system to display the query result on the Result window. Since this is the default mode, the DISPLAY command is typically used to return to normal display operation following the execution of a NODISPLAY command (see NODISPLAY command, below).

The syntax is:

DISPLAY;

The DISPLAY command must be placed immediately after the query statement on which you want it to take effect.

For example:

SELECT pno, pname FROM part WHERE color='BLUE';
DISPLAY;

When the system encounters this DISPLAY command, it displays the Result window containing the part number and name for all blue parts.

Once a DISPLAY command is executed, it will remain in effect for the rest of the script, or until a NODISPLAY command is encountered. Together, the DISPLAY and NODISPLAY commands can be used to selectively display or suppress the Result screens at certain points in the batch file.

For example:

SELECT * FROM customer 
WHERE state="CA"
NODISPLAY;            --Suppress Result Screen
IF FAIL EXIT;
UPDATE customer SET balance = balance - $50
WHERE state="CA";
SELECT customer.*, orders.o_no, orders.o_date
FROM customer, orders
WHERE state = "CA";
DISPLAY;            --Display Result Screen

This example suppresses the Result window of the first query and displays it for the second.

The Display command only works when the batch script is run from SQLWizard. To see query results when running a script from a command prompt, use the Dump or Print batch SQL command to output the results to files.

Previous Topic Next topic Print topic