SET LIST
Go Up to isql Command Reference
Specifies whether output appears in tabular format or in list format.
SET LIST [ON | OFF];
Argument | Description |
---|---|
|
Turns on list format for display of output |
|
Turns off list format for display of output [default] |
Description: By default, when a SELECT
statement retrieves rows from a query, the output appears in a tabular format, with data organized in rows and columns.
Use SET LIST ON
to change the default behavior and display output in a list format. In list format, data appears one value per line, with column headings appearing as labels. List format is useful when columnar output is too wide to fit nicely on the screen.
The
ON
and OFF
keywords are optional. If they are omitted, SET LIST
switches from one mode to the other. Although you can save typing by omitting the optional keyword, including the keyword is recommended because it avoids potential confusion.Example: Suppose you execute the following statement in a script file:
SELECT JOB_CODE, JOB_GRADE, JOB_COUNTRY, JOB_TITLE FROM JOB
WHERE JOB_COUNTRY = 'Italy';
The output is:
JOB_CODE JOB_GRADE JOB_COUNTRY JOB_TITLE
======== ========= =========== ====================
SRep 4 Italy Sales Representative
Now suppose you precede the SELECT
with SET LIST ON
:
SET LIST ON;
SELECT JOB_CODE, JOB_GRADE, JOB_COUNTRY, JOB_TITLE FROM JOB
WHERE JOB_COUNTRY = 'Italy';
The output is:
JOB_CODE SRep
JOB_GRADE 4
JOB_COUNTRY Italy
JOB_TITLE Sales Representative