Product Documentation

SQL Operations Guide

Previous Topic

Next Topic

The File Definition Generating Utility

A utility has been created to aid in the process of creating a configuration file with table, field and index definitions. The utility is called the File Definition Generating Utility, ctgendef, and its syntax is as follows:

$ ctgendef table-name -u username -p password -s servername

Where:

table-name -- file name with or without a .dat extension.

  • username -- username username
  • password -- password of user
  • servername -- server where the file resides

The output of the ctgendef utility is sent to the console. It may be captured to a file using default shell arguments. For example:

$ ctgendef table-name -u username -p password -s servername > ctsqlcbk.ini

If multiple tables are to be added to the configuration file, the following commands may be used:

$ ctgendef table1 -u username -p password -s servername > ctsqlcbk.ini

$ ctgendef table2 -u username -p password -s servername >> ctsqlcbk.ini

$ ctgendef table3 -u username -p password -s servername >> ctsqlcbk.ini

$ ctgendef table4 -u username -p password -s servername >> ctsqlcbk.ini

Example

$ ctgendef nmalert

[nmalert]

field = number, CT_FSTRING, 10

field = seq, CT_INT2, 2

field = modwhen, CT_INT4, 4

field = modby, CT_INT2, 2

field = code, CT_FSTRING, 5

index = 12, 2

segment = number, 2

segment = seq, 8

index = 13, 2

segment = code, 2

Notice that the ctgendef utility outputs the definition of the modwhen field as CT_INT4 as declared in the nmalert’s DODA. You need to edit the configuration file and, in the particular case of the nmalert table, change the definition of the modwhen field to CT_TIMES. After this modification, the configuration looks as the following, noting the change to the field=modwhen entry.

Example

[nmalert]

field = number, CT_FSTRING, 10

field = seq, CT_INT2, 2

field = modwhen, CT_TIMES, 8

field = modby, CT_INT2, 2

field = code, CT_FSTRING, 5

index = 12, 2

segment = number, 2

segment = seq, 8

index = 13, 2

segment = code, 2

TOCIndex