Home page  
Help >
DDL Command SELECT
Version 7.11
SELECT

SELECT is used only in Special Procedures or in the Report Writer. Its purpose is to isolate records into another collection for further processing.

Syntax:
SELECT/options collection tablename

Notation standards Options Answers

Options:
B - Select all bolded records, not necessarily the current record.
X - Suppress the command response.
Y - Do not alter the command answer cells.

Answers:
If no B option:
Ctl.Ans1= The record number of the selected record
Ctl.Ans2= 1 if record was added to the target collection,
0 if it was already there so this select didn't add it
Ctl.Ans3= Zero

If B option:
Ctl.Ans1= The number of bolded records
Ctl.Ans2= The number of the above that were added to the target
collection. %answer2 will be different from %answer if
some of the selected records were already there.
Ctl.Ans3= Zero

Notes:

SELECT when used in Special Procedures:

On all screens (UPDATE, READ, SCROLL) the user can select records with a shift-click. Records thus selected are bolded so they can be distinguished from unselected records. With the B option on the SELECT command you can transfer all the selected records to a different collection. This applies to APPEND also, once any record has been written, the user can back up to it and select it.

SELECT without the B option applies to the current record on the screen whether or not the user has done a shift-click. Select with the B option applies only to bolded records and so may not apply to the current record.

Multiple SELECTs keep adding to the target collection, accumulating each contribution with what was there before. That is, SELECT does not clear the collection prior to adding its contribution. So if you intend for the target collection to contain only isolations gleaned from the selects associated with a given UPDATE, you should ensure that the collection is clear before you begin the UPDATE.

The target collection must be a different collection from the parent collection used with the APPEND, UPDATE, READ, or SCROLL.

SELECT when used in Reports:

The B option does not apply to SELECT in Reports. There are no answers for the SELECT statement in Reports.

There can be as many SELECT statements as you require in the Detail, Breakpoint, or Atend sections of the report.

The record selected will be the last record read from the specified table.

If you have just done a WRITE and follow that with a SELECT for the same table as used in the WRITE, then the record selected will be the record just written.

SELECT will add records to whatever isolation is previously in that tables portion of the target collection. If you intend for the target collection to contain only the isolation selected by the Report you must ensure that the collection is CLEAR before you begin the Report.

The target collection must be different from the Report collection.

Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.