ODBC - Creating database tables from Sculptor data dictionaries

Creating database tables from Sculptor data dictionaries

The utility program dtoow is used for this purpose.

SYNTAX

dtoow [-fhiy?] [-o name] database data_dictionary [data_dictionary]…

The dtoow program is used to create database tables that correspond to Sculptor data dictionaries. Before dtoow is run, the database must be created. The tool to do this will be provided by the database product. dtoow then generates SQL statements to create the database specified in database from the specified Sculptor data dictionaries. Secondary indexes defined for the data dictionaries are converted to indexes on the ODBC tables.

The dtoow program may be run in interactive mode or in batch mode. The default is interactive mode – use the –i option for batch mode.

In interactive mode, dtoow creates empty tables on the database, corresponding to the Sculptor data dictionary files listed on the command line. It creates an SQL command file that defines the tables and their indexes – this can be very useful if the tables are to be created again later. Optionally, a Sculptor program that can be used to populate the database from Sculptor data files can also be generated.

In batch mode, dtoow creates the SQL command file, but does not create tables in the database. The tables can be created by running the command file with an SQL interpreter. Most database products provide a tool suitable for doing this.

Array fields are not supported in SQL databases. Sculptor converts an array field to a set of single fields, one for each element, by appending _N to the field name, where N is the element number. For example:

myarray,,i2[5] is translated to myarray_1, myarray_2, myarray_3, myarray_4 and myarray_5.

database

The name of an ODBC source, which must have been created using the ODBC configuration program in the system Control Panel.

data_dictionary

Each data_dictionary listed is the name of a Sculptor data dictionary file. These have a .d extension. See Data dictionaries for full details.

[-fhiy?]
[-o name]

Command line options.


Command line options

-f

Generate a program to populate the database.

-h, -?

Display a help screen listing these options. No other action is taken.

-i

Disable interactive mode. Don’t create tables. (See above)

-o name

The base name for output files. These default to database.sql, database.f and database.h.

-y

Answer ‘yes’ to all questions (such as “Overwrite existing file?”)


RELATED TOPICS

ODBC