IBM Books

Net.Data Administration and Programming Guide for OS/400

Configuring the SQL Language Environment

Use the following steps to configure the SQL language environment.

  1. Create a directory entry for the local database in the relational database directory (that is, a directory entry with a remote location of *LOCAL), in addition to any remote databases that the SQL language environment will access. Add the entry by using the Add Relational Database Directory Entry (ADDRDBDIRE) command.

    If you chose to not create a Net.Data initialization file, the SQL language environment is enabled by default. There is no additional configuration necessary.

  2. Modify the Net.Data initialization file.

    1. If you created an initialization file, and you want to use the SQL language environment, add the following configuration statement in the initialization file. The text of this environment statement must all be on one line in the initialization file. It is shown here divided between multiple lines for readability.
      ENVIRONMENT(DTW_SQL) /QSYS.LIB/QTCP.LIB/QTMHSQL.SRVPGM ( )
        (IN DATABASE, LOGIN, PASSWORD, TRANSACTION_SCOPE, SHOWSQL,
        DTW_SET_TOTAL_ROWS, DB_CASE, START_ROW_NUM, RPT_MAX_ROWS,
        OUT DTWTABLE, SQL_CODE, TOTAL_ROWS)
      

      You do not need to specify all the variables specified above in the environment statement. If you do not use a variable, such as DTW_SET_TOTAL_ROWS and TOTAL_ROWS, you can remove it from the environment statement. An alternative way of passing these variables to the SQL language environment is by passing the variables on the Net.Data function call in your macro. For information on the language environment variables, see the Net.Data Reference.

    2. Add or update configuration variables. The SQL language environment supports the following configuration variables that can be specified in a Net.Data initialization file as shown in Table 1:

      Table 1. SQL Language Environment Configuration Variables
      Configuration Variable Description
      DTW_SQL_ISOLATION Determines the degree to which the database operations executed by the SQL language environment are isolated from concurrently executing processes. Possible values are:

      DTW_SQL_NO_COMMIT

      DTW_SQL_READ_UNCOMMITTED

      DTW_SQL_READ_COMMITTED

      DTW_SQL_REPEATABLE_READ

      DTW_SQL_SERIALIZABLE

      The default is DTW_SQL_READ_UNCOMMITTED.

      DTW_SQL_NAMING_MODE Determines how a table name can be specified in an SQL statement. Possible values are:

      SQL_NAMING

      SYS_NAMING

      Default is SQL_NAMING.

For more information on the Net.Data initialization file, including environment configuration statements and configuration variable statements, see Configuring Net.Data.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]