SAVING { UNIQUE}

SAVING { UNIQUE } {MULTI.VALUE}

Top  Previous  Next

 

The SAVING clause can be used in a SELECT or SSELECT command to save the content of a field in place of the record id.

 

 

Format

 

SAVING {UNIQUE} {MULTI.VALUE} field.name {NO.NULLS}

 

where

 

UNIQUEspecifies that duplicate values are not to be repeated in the saved list.

 

MULTI.VALUEspecifies that values and subvalues in the field are to be saved as separate list entries. The alternative spelling, MULTIVALUED, may be used.

 

field.nameis the field or evaluated expression to be saved.

 

NO.NULLScauses null values to be omitted from the saved list.

 

 

The SAVING clause changes the action of SELECT or SSELECT to save the content of a field (D or I-type) or evaluated expression into the target select list in place of the record id. It is normally used to saved fields which are ids of records in some other file.

 

Use of the UNIQUE keyword suppresses multiple inclusion of the same field value in the list.

 

For compatibility with other products, the SAVING clause normally saves only the first value in a multivalued field. Use of the MULTI.VALUE keyword causes each value or subvalue to be inserted in the list as a separate entry.

 

 

Also for compatibility with Pick style systems, a command such as

SELECT ORDERS PART.NO

where PART.NO is a field name is equivalent to

SELECT ORDERS SAVING MULTI.VALUE PART.NO

 

 

Example

 

SELECT INVOICES SAVING UNIQUE SITE.REF

 

This command creates a save list of all the site references appearing in the invoices file. The UNIQUE keyword ensures that site references only appear once regardless of the number of invoices that refer to them.