/whr

Copy selected occurrences. Only applicable if the source of /cpy is a database.

/whr={"}SelectClause 1{;SelectClause n }{"}

SelectClause is FieldOperatorSpecification

/whr="name.employee=a*;name.employee=b*"

Used With

/cpy

Parameters

  • SelectClause—selection criteria for the occurrences to be copied.

  • Field—name of a field in the source entity.

  • Operator—logical operator such as = or > or >.

  • Specification—field value string specifying the objects to be copied.

Description

Use the /whr sub-switch with /cpy to select the data to be copied from a database to a file, or converted from one database to another. When you use /whr, Source cannot be a file.

Separate the select clauses with semicolons (;). The quotations marks surrounding the clauses are optional, but are suggested to ensure that characters that have special meaning to the operating system are properly interpreted. A maximum of 512 bytes is allowed. Although this limit is imposed by Uniface, different operating systems can impose their own limits that may be smaller.

Queries are made on the internal format of the data, without considering any external formatting, such as display formats of the fields.

Note:  If the field data type is Date, the value must be within double quotes. For example /whr="DATEFLD="20000101""

Escaping Profile Characters

On the command line, it is not possible to enter wildcards and profile characters using the Gold key. Instead, characters such as *, =, and & are converted to Uniface profile characters to allow clauses such as >=a&<=b.

If you need to search for one of these characters as a literal, you need to prefix the character with %%. For example, the following command copies occurrences where FLD = 'a=b':

/whr="FLD=a%%=b"

For example, to copy all occurrences where the value in the field PRICE is between 1000 and 2000:

/whr="price>=1000&<=2000"