Version 4.2.6 for Mainframes
 —  Database Management System Interfaces  —

NSQ - General Information

With the Natural interface to SQL/DS, a Natural user can access data in an SQL/DS database. Natural for SQL/DS is supported in CICS and batch environments under z/VSE.

In general, there is no difference between using Natural with SQL/DS and using it with Adabas, DB2 or DL/I. The Natural interface to SQL/DS allows Natural programs to access SQL/DS data by using the same Natural DML statements that are available for Adabas, DB2 and DL/I. Therefore, programs written for SQL/DS tables can also be used to access Adabas, DB2 or DL/I databases. In addition, Natural SQL statements are available.

All operations requiring interaction with SQL/DS are performed by the Natural interface module.

This section covers the following topics:


Accessing an SQL/DS Table

To be able to access an SQL/DS table with a Natural program, the following steps must be taken:

  1. Use the SYSSQL utility to define an SQL/DS table.

  2. Use Predict or the SQL Services function of the Natural utility SYSDDM to create a Natural DDM of the defined SQL/DS table.

  3. Once you have defined a DDM for an SQL/DS table, you can access the data stored in this table by using a Natural program.

The Natural interface to SQL/DS translates the statements of a Natural program into SQL statements.

Natural automatically provides for the preparation and execution of each statement. In dynamic mode, a statement is only prepared once (if possible) and can then be executed several times. For this purpose, Natural internally maintains a table of all prepared statements.

Almost the full range of possibilities offered by the Natural programming language can be used for the development of Natural applications which access SQL/DS tables. For a number of Natural DML statements, however, there are certain restrictions and differences as far as their use with SQL/DS is concerned; see Natural DML Statements. In the Natural Statements documentation, you can find notes on Natural usage with SQL/DS in the descriptions of the statements concerned.

As there is no SQL/DS equivalent to Adabas ISNs (Internal Sequence Numbers), any Natural features which use ISNs are not available when accessing SQL/DS tables with Natural.

For SQL databases, in addition to the Natural DML statements, Natural provides SQL statements; see Natural SQL Statements. In the Natural Statements documentation you can find a detailed description of these statements.

Top of page

Integration with Predict

As Predict supports SQL/DS, direct access to the SQL/DS catalog is possible via Predict, and information from the SQL/DS catalog can be transferred to the Predict dictionary to be integrated with data definitions for other environments.

SQL/DS databases, tables and views can be incorporated and compared, new SQL/DS tables and views can be generated and Natural DDMs can be generated and compared. All SQL/DS-specific data types and the referential integrity of SQL/DS are supported. See the relevant Predict documentation for details.

In addition, Predict active references support static SQL for SQL/DS.

Top of page

Natural System Messages Related to SQL/DS

The message number ranges of Natural system messages related to SQL/DS are 3700-3749 4750 - 4799, 6700 - 6799 and 7386-7395.

Top of page