Version 4.2.6 for Mainframes
 —  Database Management System Interfaces  —

NDB - Natural System Variables

When used with DB2, there are  restrictions for the following Natural system variables:


*ISN

As there is no DB2 equivalent of Adabas ISNs, the system variable *ISN is not applicable to DB2 tables.

Top of page

*NUMBER

When used with a FIND NUMBER or HISTOGRAM statement, *NUMBER contains the number of rows actually found.

When applied to data from a DB2 table in any other case, the system variable *NUMBER only indicates whether any rows have been found. If no rows have been found, *NUMBER is "0". Any value other than "0" indicates that at least one row has been found; however, the value contained in *NUMBER has no relation to the number of rows actually found.

The reason is that if *NUMBER were to produce a valid number, Natural would have to translate the corresponding FIND statement into an SQL SELECT statement including the special function COUNT(*); however, a SELECT containing a COUNT function would produce a read-only result table, which would not be available for updating. In other words, the option to update selected data was given priority in Natural over obtaining the number of rows that meet the search criteria.

To obtain the number of rows affected by the Natural SQL statements Searched UPDATE, Searched DELETE and INSERT, the Natural subprogram NDBNROW is provided. Alternatively, you can use the Natural system variable *ROWCOUNT as described in the Natural System Variables documentation.

Top of page