Schema Generator, Data Dictionary Questions
Posted in 1993
I am building a combination schema generator which produces a dbschema-like
sql command file for database creation. Additionally, it supports a
minimal data dictionary.
The basic idea of the schema generator is to populate two tables very
similar to systables and syscolumns via forms, then extract and generate
the sql command text file.
PROBLEMS
At this point I am having trouble reverse engineering values in the
syscolumns.collength field back to their english equivalents which were
used to build the column when the table was created (or last altered).
The formula used to compute the values is data-dependant. For chars it
is easy, for others not so easy. As an example the formula used to
compute collength for decimal data is:
collength = (precision * 256) + scale
where precision and scale are chosen at variable declaration, as in:
create table foo (
bar decimal(precision,scale)
);
Given a collength, the formula has two unknowns, making it impossible
to solve (a collength of 256 could be produced with precision = 1 and
scale = 0, or precision = 0 and scale = 256).
QUESTIONS
I was wondering if anyone out there in Informixland already has heard
of or built such a product?
How does Informix reverse-engineer the collengths back to useable
values? There must be another system table somewhere. Anyone out
there know how Informix does it?
No data dictionary questions (yet, it's a very simple dictionary).
Bill Gale
bgale@portal.hq.videocart.com