PREDICATE [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
PREDICATE
The PREDICATE statement aids in locking database items. Without this
statement, the PACK statement must be used to build a predicate string
for the DBLOCK statement. The TurboIMAGE/3000 database requires a
precise format for this string. The PREDICATE statement builds the
string in the correct format and requires only the relevant information.
An entire dataset, items within a dataset, or even a subset of an item
can be locked using the PREDICATE statement. Note that more than one
lock specification may be given at once. The string resulting from the
PREDICATE statement is used in the DESCRIPTOR clause of the DBLOCK
statement to lock the database.
Syntax
PREDICATE whole_str FROM dataset
[ [{>=} ] ]
[WITH item_name [{<=} expr] ]
[ [{= } ] ]
[[{,} [ [{>=} ]]] ]
[[{;} dataset [WITH item_name[{<=} expr]]]...]
[[ [ [{= } ]]] ]
Parameters
whole_str A string variable or string array element that is filled
by the PREDICATE statement with the locking information
required by TurboIMAGE. The string can then be used in
the DBLOCK statement to perform the locking.
dataset The dataset name or number to be locked. If the WITH
clause is not given the entire dataset is locked.
Otherwise, items within the dataset are locked.
item_name A string expression containing "@" or the name of the
database item to lock. The item must be in the dataset
requested. If item_name is not "@", then the relational
operators and the value of the data item to be locked
must be included. If they are not, database error -123,
"illegal relop in a descriptor" will result.
expr An expression used to limit which items are locked.
Only the items from item_name that satisfy the relation
are locked. If the WITH option is not selected, then
the entire dataset is locked.
Examples
The following examples show the PREDICATE statement.
100 PREDICATE Pred$ FROM Dset$ WITH Item$="xyz"; Dset2$ WITH Name$ >="TOYS"
200 PREDICATE Pred$ FROM Dset1$; Dset2$; "parts"
300 PREDICATE Pred$ FROM Dset1$; Dset2$ WITH Item$ = "skates"
400 DBLOCK Base$, MODE=5, DESCRIPTOR= Pred$
MPE/iX 5.0 Documentation