Difference between revisions of "LIST"
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
List the contents of the active table and any related tables | List the contents of the active table and any related tables | ||
− | |||
==Syntax== | ==Syntax== | ||
Line 14: | Line 13: | ||
[OFF] | [OFF] | ||
− | [TO FILE <.txt filename> | (<expC>) | + | [TO FILE <.txt filename> | (<expC>)] |
[WHILE <condition>] | [WHILE <condition>] | ||
− | |||
==See Also== | ==See Also== | ||
− | + | [[DIR]], [[DISPLAY]], [[Display and List]], [[DISPLAY MEMORY]], [[DISPLAY STATUS]], [[DISPLAY STRUCTURE]], [[SCOPE]], [[SET DESCRIPTIONS]], [[SET FILTER]] [[SET RELATION]] | |
==Description== | ==Description== | ||
− | The LIST command is a general purpose Recital | + | The LIST command is a general purpose Recital query command that retrieves and displays the contents of table files. The expressions that you specify can be any valid Recital expression, including the use of alias pointers into other workareas. If you have SET RELATION TO another table, for each record that is read from the active table, the related table will have its record pointer positioned, and the appropriate record read into its workarea. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | If SET FILTER TO <condition> is in effect, only those records that satisfy the filter <condition> will be displayed. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 45: | Line 40: | ||
|- | |- | ||
|TO <file>||The display output will be sent to the specified file. The filename can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename. If no file extension is specified, then ".txt" will be used. The command SET PAGELENGTH governs the output file pagination and SET PAGEWIDTH defines the width of each page. Page numbers are centered on the bottom of the page according to width. | |TO <file>||The display output will be sent to the specified file. The filename can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename. If no file extension is specified, then ".txt" will be used. The command SET PAGELENGTH governs the output file pagination and SET PAGEWIDTH defines the width of each page. Page numbers are centered on the bottom of the page according to width. | ||
− | |||
− | |||
|- | |- | ||
|WHILE <condition>||The [[SCOPE]] defaults to REST and records are displayed until the <condition> becomes false. | |WHILE <condition>||The [[SCOPE]] defaults to REST and records are displayed until the <condition> becomes false. | ||
|- | |- | ||
|} | |} | ||
− | |||
==Example== | ==Example== | ||
Line 61: | Line 53: | ||
</code> | </code> | ||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
[[Category:Table Basics]] | [[Category:Table Basics]] | ||
[[Category:Table Basics Commands]] | [[Category:Table Basics Commands]] |
Revision as of 12:42, 9 February 2012
Contents
Purpose
List the contents of the active table and any related tables
Syntax
LIST [<scope>]
[FIELDS <field list>|<exp list>]
[FOR <condition>]
[HEADING]
[OFF]
[TO FILE <.txt filename> | (<expC>)]
[WHILE <condition>]
See Also
DIR, DISPLAY, Display and List, DISPLAY MEMORY, DISPLAY STATUS, DISPLAY STRUCTURE, SCOPE, SET DESCRIPTIONS, SET FILTER SET RELATION
Description
The LIST command is a general purpose Recital query command that retrieves and displays the contents of table files. The expressions that you specify can be any valid Recital expression, including the use of alias pointers into other workareas. If you have SET RELATION TO another table, for each record that is read from the active table, the related table will have its record pointer positioned, and the appropriate record read into its workarea.
If SET FILTER TO <condition> is in effect, only those records that satisfy the filter <condition> will be displayed.
Keyword | Description |
---|---|
<scope> | If the SCOPE is not specified, all records will be displayed, unless the WHILE clause is used, in which case it will default to REST. |
FOR <condition> | Only those records that satisfy the <condition> are displayed. |
OFF | Disables the display of the record number in the first column of the results. |
FIELDS <list> | Restricts the fields displayed to those specified. |
HEADING | A heading corresponding to either the field names or the expression will be displayed above each column even if SET HEADING is OFF. |
TO <file> | The display output will be sent to the specified file. The filename can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename. If no file extension is specified, then ".txt" will be used. The command SET PAGELENGTH governs the output file pagination and SET PAGEWIDTH defines the width of each page. Page numbers are centered on the bottom of the page according to width. |
WHILE <condition> | The SCOPE defaults to REST and records are displayed until the <condition> becomes false. |
Example
open database southwind use products order categoryid seek 2 list productid, productname while categoryid = 2