Enterprise Developer に付属している複数の SQL プリプロセッサから選択し、アプリケーションをコンパイルします。
- OpenESQL
- Before compiling from within
Enterprise Developer:
- 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.
- If unchecked, check
Enable configuration specific settings and
Use SQL Preprocessor.
- From the
ESQL PreprocessorPreprocessor Type drop-down list, select
OpenESQL.
- Click
Add; then click
DBMAN on the list of directives.
- From the
Value drop-down list, select
ODBC or
ADO; then click
OK.
- To add another directive, select a directive from the
Available Directives list.
- If required, provide details using the controls under
Directive Details.
- Click
OK. The directive is added to the
SQL Directives field.
- Repeat this procedure to add additional directives.
- Type the name of your database into the
Value field of the DB setting.
- To specify the type of database access you want, use the grid to set the value of the DBMAN directive to
ODBC or
JDBC.
- Click
Apply.
- 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:
- 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.
- 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
-
- 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.
- Check
Enable configuration specific settings and
Use SQL Preprocessor.
- From the
ESQL PreprocessorPreprocessor Type drop-down list, select
DB2HCO for DB2 LUW.
- 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.
- Click
Apply.
Alternatively, you can enter the preprocessor specification and options as additional directives:
- 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.
- 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)
-
- プロジェクト プロパティを開き、[SQL] タブをクリックします[Micro Focus] > [プロジェクト設定] > [COBOL] > [SQL プリプロセッサ] の順に展開します。
注: [Micro Focus] > [ビルド構成] > [COBOL] > [SQL プリプロセッサ] の下でプリプロセッサを設定することもできます。この方法では、設定はビ
ルド構成がアクティブになっている場合のみ適用され、[Project Settings] 内またはプログラム レベルでプリプロセッサが他のプリプロセッサに設定されることはありません。
- [EXEC SQL] をオンにします。
- [ESQL プリプロセッサ] の [プリプロセッサ タイプ] ボックスの一覧から、[XDB] を選択します。
- 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:
- Expand
Micro Focus > Project Settings > COBOL > SQL Preprocessor.
- Check
Use SQL Preprocessor.
- From the
Preprocessor Type list, select
Oracle Pro*COBOL(COBSQL).
- Under
Setting choose a directive and specify its value under
Value.
- Repeat the previous step to add additional directives.
- 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:
- From the Solution Explorer, open your project properties, then click the
SQL tab.
- From the
ESQL Preprocessor list, select
Oracle Pro*COBOL (COBSQL).
- Click
Add, select a directive from the
Available Directives list, then click
OK. This places the directive in the
Directives list.
- 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.
- 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.
- 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.