![]() | Catalog Database | DCLGEN | ![]() |
The DDL Processor processes SQL DDL statements by:
or
See the chapter Product Specifications for more information about supported statements and limitations.
The DDL Processor tool (see Figure 9-1) appears when you select HCO > DDL Processor on the IDE Tools menu.
Figure 9-1: DDL Processor Window
The following elements make up the DDL Processor window:
The following list shows the buttons in the toolbar and the functions that they invoke:
Button |
Function |
---|---|
Select DDL file to be processed. You see a window (see Figure 9-2) where you can select a DDL file. | |
Process DDL statements | |
Display the online HCO User's Guide, a hypertext file that describes how the DDL Processor tool works. |
The menu bar is an alternative way of invoking DDL Processor functions. It consists of three menus: File, Options and Help.
To select a DDL file, process the DDL file or exit from the tool, you can use the File menu. You can also display this menu by right-clicking with the mouse on the DDL Processor window (see Figure 9-1). The following list shows the menu options and the functions that they perform:
Option |
Function |
---|---|
Process DDL | Process DDL statements |
Select DDL | Select DDL file to be processed. You see a window (see Figure 9-2) where you can select a DDL file. |
Exit | Exit from the DDL processor tool |
You can override options set in the configuration file by selecting the Options menu. These options are pre-defined. See the chapter Setting INI Options for more details. The settings depend on your current environment and what you have set as defaults. The following list shows the menu options and the functions that they perform:
Option |
Function |
---|---|
Modify DDL | Convert DDL statements from DB2/MVS or DB2/VM format to DB2 Universal Database format. If you turn this option off, you must specify the character to use as a statement delimiter in the configuration file. See the chapter Setting INI Options for more details. |
Display log | Display the DDL log file after DDL statements have been processed. |
Max column | You can select the maximum column to process DDL statements to. You should set this value if you have line numbers in columns 72 through 80. |
Preview | You can preview the changes that Host Compatibility Option makes to the DDL by setting this option on. By selecting this option, no changes are made to the database. |
To process DDL statements:
When the DDL file has been processed, the log file is displayed (see Figure 9-3) if the Display Log flag is set on.
There are two ways to provide DDL filenames. You can:
The default list is built using the current Mainframe Express project \data folder and .ddl extension. See the chapter Setting INI Options for more details of setting defaults.
Select the file that you want to process from the left list box and then click on Open. You then see the filename in DDL File.
Figure 9-2: Select DDL File
You can also specify the name of the log file where the output is to be written. The log file contains the original statement, the statement that it is converted to (if needed) and the return code from processing the statement. The default name for the log file is set in the configuration file. See the chapter Setting INI Options for more details. You overwrite the log file if you use the same filename. If you have Display Log checked, the log is displayed in the HCO Log tab of the IDE; Figure 9-3 shows the processing summary. You also need to have Output selected on the View menu of the IDE for this to be displayed.
Figure 9-3: HCO Log
DDL source files on the mainframe should be downloaded and converted to standard ANSI text files. The maximum input length per record accepted by the DDL processor is 80 bytes.
Note: If non-blank characters exist in columns 73 through 80, you must change maximum column to process to be 72 or they are treated as part of the DDL source statement. See the chapter Setting INI Options for more details.
There are two tools in Host Compatibility Option to help you load test data exported from tables located on the mainframe:
See the chapters Importing Data and Exporting Data for more details.
You can also use the DDL processor to load or update data into tables. You can place the following DML statements in the same file as DDL statements:
INSERT
UPDATE
DELETE
COMMIT
This is a convenient way to load test data into tables.
Statements cannot contain any host variables and you cannot use quotes (
" ) around literals. You must use apostrophes ( ' ). You should also
issue aCOMMIT
before you try to insert data into a table if
it was created within the same unit of work. For example:
-- Create Available Product table CREATE TABLE MF.PRODUCT (PROD_ID CHAR(04) NOT NULL ,PROD_DESC CHAR(40) NOT NULL WITH DEFAULT ,VERSION CHAR(6) NOT NULL WITH DEFAULT ,PRIMARY KEY (PROD_ID) ) IN DSB8G210.CISC0001 ; COMMIT ; -- Sample data for Product table INSERT INTO MF.PRODUCT (PROD_ID ,PROD_DESC ,VERSION ) VALUES ('SR02' ,'Host Compatibility Option ' ,'2.0.01' )
The DDL Processor tool can also be run as a batch function. The command line syntax to run the tool is:
MFECL /HCODDL projectname FILE=file LOG=logfile MAX=colno MOD=modify
At least one space must occur before each parameter in the command. There must be an "=" between some parameters and their values. See examples for specific syntax.
Parameter |
Description |
---|---|
/HCODDL |
Parameter to indicate DDL Processor is to be invoked. Parameter is positional. |
projectname |
Name of the Mainframe Express project that contains the database name that you want to process DDL statements against. |
FILE=file |
The name of the file that contains DDL statements. |
You can omit optional parameters. Host Compatibility Option uses the default value set in configuration file.
Parameter
|
Description |
---|---|
LOG=logfile |
The name of log file to write processing details to. If this parameter is not specified, a default log filename is created from a combination of the drive\folder specified in the Mainframe Express project and the Host Compatibility Option configuration file. |
LOG= |
Indicates no log file is to be created. To turn off logging with new syntax, you can also just blank out the default log filename in the configuration file and omit this parameter. |
MAX=colno |
Column number to process DDL statements to. Must be a number less than or equal to 80. |
MOD=modify |
Set this parameter to "Y" if you want DDL statements converted to DB2 Universal Database format. Set this parameter to "N" if you want to process DDL statements unchanged. If you select this option, you must set the DDL delimiter value in the configuration file. |
Example 1
Example 1 processes DDL statements found in c:\ddl\sql.ddl using DB2DEMO database specified in Mainframe Express project hcodemo located in d:\mfuser\projects. Log file, maximum column to process and DDL conversion options are defaults set in the configuration file.
MFECL /HCODDL D:\MFUSER\PROJECTS\HCODEMO.MVP FILE=C:\DDL\SQL.DDL
Example 2
In this example, the DDL statements are found in c:\ddl\sql.ddl using DB2DEMO database specified in Mainframe Express project hcodemo located in d:\mfuser\projects. The log file to write to is c:\ddl.log. Maximum column is 72. Notice with the new syntax that parameters can be in any order except for the first parameter.
MFECL /HCODDL D:\MFUSER\PROJECTS\HCODEMO.MVP LOG=C:\DDL.LOG FILE=C:\DDL\SQL.DDL MAX=72
Example 3
In this example, the DDL statements are found in c:\ddl\sql.ddl using DB2DEMO database specified in Mainframe Express project hcodemo located in d:\mfuser\projects. DDL statements are not converted.
MFECL /HCODDL D:\MFUSER\PROJECTS\HCODEMO.MVP FILE=C:\DDL\SQL.DDL MOD=N
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
![]() | Catalog Database | DCLGEN | ![]() |