Difference between revisions of "SCAN"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
|||
Line 1: | Line 1: | ||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Scans over records in a table and executes a command block for each selected record. | Scans over records in a table and executes a command block for each selected record. | ||
Line 12: | Line 10: | ||
ENDSCAN | ENDSCAN | ||
− | |||
==See Also== | ==See Also== | ||
[[CONTINUE]], [[DO WHILE]], [[IF]], [[LOCATE]] | [[CONTINUE]], [[DO WHILE]], [[IF]], [[LOCATE]] | ||
− | |||
==Description== | ==Description== | ||
Line 32: | Line 28: | ||
</code> | </code> | ||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
+ | [[Category:NoSQL]] | ||
[[Category:Table Basics]] | [[Category:Table Basics]] | ||
[[Category:Table Basics Commands]] | [[Category:Table Basics Commands]] | ||
[[Category:Data Commands]] | [[Category:Data Commands]] |
Revision as of 05:10, 1 October 2012
Contents
Purpose
Scans over records in a table and executes a command block for each selected record.
Syntax
SCAN [<scope>] [FOR <condition>] [WHILE <condition>]
[EXIT]
[LOOP]
ENDSCAN
See Also
CONTINUE, DO WHILE, IF, LOCATE
Description
The SCAN ... ENDSCAN command executes a command block repeatedly FOR a specified selection of records WHILE an optionally specified condition is true, or until an EXIT is encountered. The optional LOOP keyword forces control to the beginning of the SCAN.
The SCAN...ENDSCAN command can be used to reduce the programming involved in a LOCATE ... DO WHILE ... CONTINUE construct.
Example
use customers seek "HMT" scan rest while code = "HMT" echo "name=" + name + "address=" + address endscan