Tuesday, December 7, 2010

jBase Query Language SSELECT

Generates an implicit list of record keys or specified fields, based on the selection criteria specified.
SSELECT file-specifier {record-list} {selection-criteria} {sort-criteria} {output-criteria} {USING file-specifier} {(options}

Syntax Elements

C{n} Display running counters of the number of records selected and records processed. Unless modified by n, the counter increments after every 500 records processed or the total number of records if less than 500.
N Specifies a number other than 500 by which to increment. For Example, C25 increments the counter after every 25 records processed.

Comments: Unless you specify a sort criteria clause it sorts the records in key order.

See also the SELECT Command.

If you specify an output-criteria clause, the generated list will comprise the data (field) values defined by the clause, rather than the selected record keys.
When the Command terminates, it displays the total number of entries in the generated list; the list is available to the next Command. This is indicated by the “>” prompt if you are in jSHELL.
If you use the BY-EXP or BY-EXP-DSND connectives on a multivalued field, the list will have the format:

record-key]multivalue#

where multivalue# is the position of the multivalue within the field specified by BY-EXP or BY-EXP-DSND. multivalue# can be accessed by a READNEXT Var,n statement in a jBASIC program.

Example 1

SSELECT SALES WITH S.CODE = "ABC]" 
23 Records selected 
LIST SALES WITH VALUE > "1000"
Select all the records in SALES file with an S.CODE value that starts with ABC. Sort the list into key order. Then, using the list, report on the records in the SALES file which have a VALUE field greater than 1000.

Example 2

SSELECT SALES WITH S.CODE = "ABC]" BY P.CODE
23 Records selected
SAVE-LIST SALES.ABC
Select all the records in SALES file with an S.CODE value that starts with ABC. Sort the list into P.CODE order and then save the list as SALES.ABC.

0 comments:

Post a Comment

 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems