Tests for the presence of any record in a record stream. An ANY conditional expression is true if the record stream specified by the record selection expression includes at least one record. If you precede the ANY expression with the optional NOT qualifier, the condition is true if there are no records in the record stream.
1 – Examples
The following programs demonstrate the use of the ANY conditional expression. These programs create a record stream containing all the records from the SALARY_HISTORY relation that hold a value greater than fifty thousand in the field SALARY_AMOUNT. These programs then print an informational message if one or more records are found that meet the above condition. Note that the host language print statements do not have access to the context created in the if statement.
1.1 – C Example
#include <stdio.h> DATABASE PERS = FILENAME "PERSONNEL"; int who; main() { READY PERS; START_TRANSACTION READ_ONLY; GET who = ANY SH IN SALARY_HISTORY WITH SH.SALARY_AMOUNT > 50000.00; END_GET; COMMIT; if (who) printf ("Someone is not underpaid \n"); FINISH; }
1.2 – Pascal Example
program anycond (input,output); DATABASE PERS = FILENAME 'PERSONNEL'; who : boolean; begin READY PERS; START_TRANSACTION READ_WRITE; GET who = ANY SH IN SALARY_HISTORY WITH SH.SALARY_AMOUNT > 50000.00 END_GET; COMMIT; if (who) then writeln ('Someone is not underpaid.'); FINISH; end.
2 – Format
(B)0[many-clause = qqqwqqq>qqqqqqqqwqq> [4mANY[m qqqwqq>qqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqk mqqq> [4mNOT[m qqqj mqq> handle-options qj x x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x mqqqqqqqqqqqqqqqqqqqqqq> rse qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq> (B)0[mhandle-options = q> ( qwqqqqqq> [4mREQUEST_HANDLE[m qqqqq> var qqqqqqqqwq> ) q> tqqqqqq> [4mTRANSACTION_HANDLE[m qqq> var qqqqqqqqu mqqqqqq> [4mREQUEST_HANDLE[m q> var q> , qqqqqqqk x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x mqqqq> [4mTRANSACTION_HANDLE[m q> var qqqqqqqqqqqj
2.1 – Format arguments
rse A record selection expression. A phrase that defines specific conditions that individual records must meet before Oracle Rdb includes them in a record stream. handle-options A request handle, a transaction handle, or both. REQUEST_HANDLE var The REQUEST_HANDLE keyword followed by a host language variable. A request handle identifies a compiled Oracle Rdb request. If you do not supply a request handle explicitly, RDML associates a unique request handle for the compiled request. TRANSACTION_HANDLE The TRANSACTION_HANDLE keyword followed by var a host language variable. A transaction handle identifies a transaction. If you do not supply a transaction handle explicitly, RDML uses the default transaction handle.