Tuesday, December 7, 2010

jBase Query Language SELECT

Generates an implicit list of record keys or specified fields based on the specified selection criteria.
SELECT 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.
nn Specifies a number other than 500 by which to increment. For Example, C25 increments the counter after every 25 records processed.
Comments: You must specify a sort criteria clause to sort records.

See also the SSELECT 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.
If you are in jSHELL when the Command terminates, it displays the total number of entries in the generated list and the list is made available to the next Command, as indicated by the > prompt.
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

SELECT 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. Then, using the list, report on the records in the SALES file which have a VALUE field greater than 1000.

Example 2

SELECT SALES WITH S.CODE = "ABC]" 
23 Records selected 
>SAVE-LIST SALES.ABC
Select all the records in SALES file with an S.CODE value that starts with ABC. 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