Back to Contents
Summary:
See also: Forms, Programs,
Variables, fgldbsch.
Database Schema Files are used during compilation to
indirectly define data types, default values, display attributes and validation rules
for form fields and program
variables.
In program sources or form specification files, you can specify the database schema file with the SCHEMA
instruction.
You must generate database schema files each time the database structure
changes, before compiling program modules and form specification files.
Database schema files are generated from the system tables, and from the
Informix-specific syscolatt and syscolval tables that
can be filled with the Informix upscol utility.
The FGLDBPATH
environment variable can be used to define a list of directories where the
compiler can find database schema files.
Warnings:
- The data types, display attributes and validation rules are taken from the
Database Schema Files during compilation. Make sure that the
schema files of the
development database correspond 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 Schema Extractor is the tool provided to generate the database
schema files from an existing database.
For more details, see fgldbsch.
Purpose
The Column Data Types File contains the data type definition of all
columns selected during schema extraction.
Syntax:
database.sch
Notes:
- The data type of program variables or form
fields used to hold data of a given database column must match the data
type of the corresponding column. BDL simplifies the definition of these
elements by centralizing the information in external .sch files.
- Column data types are extracted from the database system tables
(typically, syscolumns when using Informix). The native data types can be
converted to BDL data types in accordance with the conversion tables, by using the
-cv option of the fgldbsch tool.
- In programs, you can define variables with the data type of a database
column by using the LIKE
keyword.
- You can directly specify the table and column name in the field
definition in the ATTRIBUTES section
of forms.
Warnings:
- As column data types are extracted from the database system tables, you
may get different results with different database servers. For example,
Informix provides the DATE data type to store simple dates in year, month,
and day format (= BDL DATE), while
Oracle stores DATEs as year to second ( = BDL DATETIME
YEAR TO SECOND).
Purpose
The Column Attributes File contains the default display attributes of all
columns selected during schema extraction.
Syntax:
database.att
Notes:
- Column attributes in .att files are generated from the
Informix-specific syscolatt table that
can be filled with the Informix upscol utility.
- This files defines display attributes for form fields like the color or
the format.
Warnings:
- This feature is supported for compatibility with Informix 4GL only, since other
databases do not provide the upscol
utility program.
Purpose
The Column Validation File holds the value definition of all columns
selected during schema extraction.
Syntax:
database.val
Notes:
- Column validation information in .val files is generated from the
Informix-specific syscolval table that
can be filled with the Informix upscol utility.
- The information found in this file (for a given column):
- In programs, you can validate variable values in accordance with the INCLUDE
attribute by using the VALIDATE
instruction.
- In form files, the attributes are taken from the .val file as defaults
if the corresponding attribute is not explicitly specified in the
field definition of the ATTRIBUTES
section.
Warnings:
- This feature is supported for compatibility with Informix 4GL only, since
databases do not provide the upscol
utility program.