Natural and Database Access

This document gives an overview of the facilities that Natural provides for accessing different types of database management and file management systems.

The following topics are covered:


Database Management Systems Supported by Natural

Natural offers specific database interfaces for the following types of database management systems (DBMS):

  • Nested-relational DBMS (Adabas)

  • SQL-type DBMS (DB2, Oracle, Sybase, Informix, MS SQL Server)

  • File systems (VSAM)

  • DL/I

The following topics are covered below:

Adabas

Via its integrated Adabas interface, Natural can access Adabas databases either on a local machine or on remote computers. For remote access, an additional routing and communication software such as Entire Net-Work is necessary. In any case, the type of host machine running the Adabas database is transparent for the Natural user.

SQL Databases

Natural for DB2 offers one common set of statements to access DB2 database management systems. For detailed information, refer to Natural for DB2 in the Database Management System Interfaces documentation:

VSAM

With the Natural interface to VSAM, a Natural user can access data stored in VSAM files. For detailed information and special considerations on the use of Natural statements and system variables with VSAM, see Natural for VSAM in the Database Management System Interfaces documentation.

DL/I

With Natural for DL/I, a Natural user can access and update data stored in a DL/I database. The Natural user can be executing in batch mode or under the control of the TP monitor CICS or IMS TM. A DL/I database is represented to Natural as a set of files, each file representing one database segment type. Each file or segment type must have an associated DDM generated and stored on the Natural FDIC system file.

The Natural statements used to access DL/I databases are a subset of those provided with the Natural language. No new statements are needed to access a DL/I database.

For further information, see Natural for DL/I in the Database Management System Interfaces documentation.

Profile Parameters Influencing Database Access

There are various Natural profile parameters to define how Natural handles the access to databases.

For an overview of these profile parameters, see the section Database Management in Profile Parameters Grouped by Category in the Parameter Reference documentation.

For a detailed parameter description, refer to the corresponding section in the Parameter Reference.

Access through Data Definition Modules

To enable convenient and transparent access to the different database management systems, a special object, the "data definition module" (DDM), is used in Natural. This DDM establishes the connection between the Natural data structures and the data structures in the database system to be used. Such a database structure might be a table in an SQL database or a file in an Adabas database. Hence, the DDM hides the real structure of the database accessed from the Natural application. DDMs are created using the Natural DDM editor.

Natural is capable of accessing multiple types of databases (Adabas, DB2, VSAM or DL/I from within a single application by using references to DDMs that represent the specific data structures in the specific database system. The diagram below shows an application that connects to different types of database.

graphics/dba_mf.png

Natural's Data Manipulation Language

Natural has a built-in data manipulation language (DML) that allows Natural applications to access all database systems supported by Natural using the same language statements such as FIND, READ, STORE or DELETE. These statements can be used in a Natural application without knowing the type of database that is going to be accessed.

Natural determines the real type of database system from its configuration files and translates the DML statements into database-specific commands; that is, it generates direct commands for Adabas, SQL statement strings and host variable structures for SQL databases.

Because some of the Natural DML statements provide functionality that cannot be supported for all database types, the use of this functionality is restricted to specific database systems. Please, note the corresponding database-specific considerations in the statements documentation.

Natural's Special SQL Statements

In addition to the "normal" Natural DML statements, Natural provides a set of SQL statements for a more specific use in conjunction with SQL database systems; see SQL Statements Overview (in the Statements documentation).

Flexible SQL and facilities for working with stored procedures complete the set of SQL commands. These statements can be used for SQL database access only and are not valid for Adabas or other non-SQL-databases.