SQL プリプロセッサ

Enterprise Developer に付属している複数の SQL プリプロセッサから選択し、アプリケーションをコンパイルします。
OpenESQL
Before compiling from within Enterprise Developer:
  1. Open your project properties and click the SQL tabexpand Micro Focus > Project Settings > COBOL > SQL Preprocessor.
    注: You can also set compiler directive options under Micro Focus > Build Configurations > COBOL > SQL Preprocessor. If you do this, the setting applies only when the build configuration is active, and the compiler directive option is not set to something else in the Project Settings or on the program level.
  2. If unchecked, check Enable configuration specific settings and Use SQL Preprocessor.
  3. From the ESQL PreprocessorPreprocessor Type drop-down list, select OpenESQL.
  4. Click Add; then click DBMAN on the list of directives.
  5. From the Value drop-down list, select ODBC or ADO; then click OK.
  6. To add another directive, select a directive from the Available Directives list.
  7. If required, provide details using the controls under Directive Details.
  8. Click OK. The directive is added to the SQL Directives field.
  9. Repeat this procedure to add additional directives.
  10. Type the name of your database into the Value field of the DB setting.
  11. To specify the type of database access you want, use the grid to set the value of the DBMAN directive to ODBC or JDBC.
  12. Click Apply.
  13. Use the grid to select additional directive options and set appropriate values. Click Apply after each setting.

Alternatively, you can enter the preprocessor specification and options as additional directives:

  1. Open your project properties and expand Micro Focus > Project Settings > COBOL.
    注: You can also set the preprocessor under Micro Focus > Build Configurations > COBOL. If you do this, the setting applies only when the build configuration is active, and the preprocessor is not set to something else in the Project Settings or on the program level.
  2. Click in the Additional directives field and type:
    SQL(DBMAN=dbaType [SQLdirOpt])

    Where dbaType is ODBC or JDBC, and SQLdirOpts is one or more additional directive options.

DB2 ECM
  1. Open your project properties and click the SQL tabexpand Micro Focus > Project Settings > COBOL > SQL Preprocessor.
    注: You can also set the preprocessor under Micro Focus > Build Configurations > COBOL > SQL Preprocessor. If you do this, the setting applies only when the build configuration is active, and the preprocessor is not set to something else in the Project Settings or on the program level.
  2. Check Enable configuration specific settings and Use SQL Preprocessor.
  3. From the ESQL PreprocessorPreprocessor Type drop-down list, select DB2HCO for DB2 LUW.
  4. Type the name of your database into the Value field of the DB setting. Click Add and choose DB from the list of directives, and click OK. Type the name of your database into the Value field of the directive details.
    注: If you leave the value for DB blank, the compiler uses the database specified by the value of the DB2DBDFT environment variable.
  5. Click Apply.

Alternatively, you can enter the preprocessor specification and options as additional directives:

  1. Open your project properties and expand Micro Focus > Project Settings > COBOL.
    注: You can also set the preprocessor under Micro Focus > Build Configurations > COBOL. If you do this, the setting applies only when the build configuration is active, and the preprocessor is not set to something else in the Project Settings or on the program level.
  2. Click in the Additional directives field and type:
    DB2[(DB=dbName [DB2dirOpts])]

    Where dbName is the name of your DB2 database, and DB2dirOpts is one or more additional directive options.

    注: If you do not specify the DB option, the compiler uses the database specified as the value of the DB2DBDFT environment variable.
XDB (Windows)
  1. プロジェクト プロパティを開き、[SQL] タブをクリックします[Micro Focus] > [プロジェクト設定] > [COBOL] > [SQL プリプロセッサ] の順に展開します
    注: [Micro Focus] > [ビルド構成] > [COBOL] > [SQL プリプロセッサ] の下でプリプロセッサを設定することもできます。この方法では、設定はビ ルド構成がアクティブになっている場合のみ適用され、[Project Settings] 内またはプログラム レベルでプリプロセッサが他のプリプロセッサに設定されることはありません。
  2. [EXEC SQL] をオンにします。
  3. [ESQL プリプロセッサ] の [プリプロセッサ タイプ] ボックスの一覧から、[XDB] を選択します。
  4. Client Options コンソール (Start > All Programs > Micro Focus Enterprise Developer> [Data Tools] > [SQL Option for DB2] > [Configuration] > [Client Options] をクリック) でデータベースを構成します。
COBSQL
Before compiling from within Enterprise Developer:
注: You can also set the preprocessor under Micro Focus > Build Configurations > COBOL > SQL Preprocessor. If you do this, the setting applies only when the build configuration is active, and the preprocessor is not set to something else in the project settings or at the program level.

For Oracle Pro*COBOL, you can set the COBSQL preprocessor and compiler directives from the project's properties:

  1. Expand Micro Focus > Project Settings > COBOL > SQL Preprocessor.
  2. Check Use SQL Preprocessor.
  3. From the Preprocessor Type list, select Oracle Pro*COBOL(COBSQL).
  4. Under Setting choose a directive and specify its value under Value.
  5. Repeat the previous step to add additional directives.
  6. Click Apply, then click OK.
注: Ensure that no conflicting preprocessor directives are set in Additional Directives.

For Oracle Pro*COBOL, you can set the COBSQL preprocessor and compiler directives from the SQL tab in your project properties:

  1. From the Solution Explorer, open your project properties, then click the SQL tab.
  2. From the ESQL Preprocessor list, select Oracle Pro*COBOL (COBSQL).
  3. Click Add, select a directive from the Available Directives list, then click OK. This places the directive in the Directives list.
  4. Optionally, you can change the details for a directive by selecting it from the Directives list and then modifying the fields and controls under Directive Details.
  5. Repeat the previous two steps to add additional directives.
    注: When using this method, you can also specify Pro*COBOL directives to pass to the database precompiler by typing them directly into the Additional Directives field.
  6. Click Apply and then OK.
注: Adding the Oracle Pro*COBOL (COBSQL) preprocessor to the SQL PreprocessorSQL file, build configuration or project property page automatically adds a read-only entry to the top of the preprocessors list in the Additional PreprocessorsSQL property page. If you have multiple preprocessors in the preprocessors list, you can change the sequence of execution by moving preprocessors up and down the list. See section Additional Preprocessors for more information.