Producting database schema files (fgldbsch)

Database schema files are based on the definition of database tables in catalog tables. Schema files are used during program compilation to define data types, default values, display attributes and validation rules for form fields and program variables. You must generate database schema files each time the database structure changes, before compiling any other parts of your application.

The SCHEMA statement in program source files and form files identifies the database schema file to be used. The FGLDBPATH environment variable can be used to define a list of directories where the compiler can find database schema files.

The schema extractor (fgldbsch) is the tool provided to generate the database schema files from a real database. Database schema files are generated from the system tables.

Example:
fgldbsch -db stores7

It is important that the schema file of the development database corresponds to the production database; otherwise, the elements defined in the compiled version of your modules and forms will not match the table structures of the production database.

The primary file produced by the fgldbsch utility is:

<database>.sch - the file containing the data type definition of all columns selected during schema extraction.