Importing from Dynanmic DDL Files
CONNX provides an option to import metadata from scripts containing two of Software AG's specific SQL commands: CREATE TABLE DESCRIPTION and CREATE CLUSTER DESCRIPTION.
Note:
If you wish to retain hyphens during a Windows import, you must first set the
KEEPHYPHENS variable. The default is to have it unset (0).
1. Start your Adabas database.
2. Click the Import button in the CONNX Data Dictionary Manager window.
3. Select Adabas Script DDL Import files in the Import Type list box.
4. Enter a Database ID number.
5. Add the DDL File Script number, or use the Browse button to locate the file.
6. Enter an ADASCR password, if you are using the
ADASCR security method. 7. Depending on where the database you are importing from is located, enter the following in the Server text box:
Enter "localhost" if the database is on the same Windows machine.
Enter the TCP/IP address or server name for all other instances. The CONNX Listener Task attempts to access the given server. If the server is unavailable or cannot be located, the following message appears: "The CONNX Listener process (CNXRUN##_MAIN) is not running on the system."
8. Enter a CONNX user name and password.
9. Click the OK button.
10. The CONNX Import Table Selection dialog box appears after CONNX finds the Master tables that contain the various subtables. Select each file to import, and then click the Add or Add All button.
11. The Adabas Count Selection dialog box appears. Enter the number of maximum occurrences of each field under Max Repeat, and then click the OK button.
12. Save the CDD by selecting the File menu and then clicking Save.
The imported tables appear in the CONNX Data Dictionary Manager window.
A script from the sample Employees file appears as follows. CONNX creates the various subtables, as well as the relationships between the files:
#######################################################################
# ASG Version : x.x.x.x
# Date/Time : 04/01/04
10:50:38
# File :
12:11
#######################################################################
create cluster description CLUSTER_11
database number 12
file number 11
(
create table description EMPLOYEES
(
COL_SEQNO_0 seqno(0)
not null
,PERSONNEL_ID
shortname
'AA'
,FIRST_NAME
shortname
'AC'
,NAME
shortname
'AE'
,MIDDLE_I
shortname
'AD'
,MAR_STAT
shortname
'AF'
,SEX
shortname
'AG'
,BIRTH
numeric
(6, 0)
shortname
'AH'
,CITY
shortname
'AJ'
,ZIP
shortname
'AK'
,COUNTRY
shortname
'AL'
,AREA_CODE
shortname
'AN'
,PHONE
shortname
'AM'
,DEPT
shortname
'AO'
,JOB_TITLE
shortname
'AP'
,LEAVE_DUE
shortname
'AU'
,LEAVE_TAKEN
shortname
'AV'
,primary key ( COL_SEQNO_0)
# Number of columns for this table: 17.
)
,create table description EMPLOYEES_ADDRESS_LINE
(
COL_SEQNO_0 seqno(0)
not null
,COL_SEQNO_1 seqno(1)
not null
,ADDRESS_LINE
shortname
'AI'
,foreign key ( COL_SEQNO_0)
references EMPLOYEES
,primary key ( COL_SEQNO_0,
COL_SEQNO_1)
# Number of columns for this table: 3.
)
,create table description EMPLOYEES_INCOME
(
COL_SEQNO_0 seqno(0)
not null
,COL_SEQNO_1 seqno(1)
not null
,CURR_CODE
shortname
'AR'
,SALARY
shortname
'AS'
,foreign key ( COL_SEQNO_0)
references EMPLOYEES
,primary key ( COL_SEQNO_0,
COL_SEQNO_1)
# Number of columns for this table: 4.
)
,create table description EMPLOYEES_BONUS
(
COL_SEQNO_0 seqno(0)
not null
,COL_SEQNO_1 seqno(1)
not null
,COL_SEQNO_2 seqno(2)
not null
,BONUS
shortname
'AT'
,foreign key
(COL_SEQNO_0,
COL_SEQNO_1)
references
EMPLOYEES_INCOME
,primary key ( COL_SEQNO_0,
COL_SEQNO_1, COL_SEQNO_2)
# Number of columns for this table: 4.
)
,create table description EMPLOYEES_LEAVE_BOOKED
(
COL_SEQNO_0 seqno(0)
not null
,COL_SEQNO_1 seqno(1)
not null
,LEAVE_START
shortname
'AX'
,LEAVE_END
shortname
'AY'
,foreign key ( COL_SEQNO_0)
references EMPLOYEES
,primary key ( COL_SEQNO_0,
COL_SEQNO_1)
# Number of columns for this table: 4.
)
,create table description EMPLOYEES_LANG
(
COL_SEQNO_0 seqno(0)
not null
,COL_SEQNO_1 seqno(1)
not null
,LANG
shortname
'AZ'
,foreign key ( COL_SEQNO_0)
references EMPLOYEES
,primary key ( COL_SEQNO_0,
COL_SEQNO_1)
# Number of columns for this table: 3.
)
);