Kbase 15022: Using metaschema info: How to get from _field to _file
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  15/06/1998 |
|
Using metaschema info: How to get from _field to _file
If you have the name of a field and you want to determine which
file(s) in the database contain a field with that name, you can do so
by looking at the _field and _file tables in the database schema.
Given that it is possible to have a field with the same name in
more than one file in the database, there is an entry in _file for
each file/field combination. That is, if the field "cust-num" is
defined for four tables in the database: Invoice, Customer, Order and
Ref-Call, there will be four records in _file which correspond to
fields named "cust-num".
Run the following code against the Sports database to confirm this
fact:
for each _field where _field._field-name = "cust-num":
find _file where RECID(_file) = _field._file-recid.
display _file.
end.
The idea is to find the record in _file which corresponds to the
field "cust-num", and to grab the RECID of that record. Once you find
the _file record you are interested in,_file-name will tell you the
name of the file to which that _file record corresponds.
Progress Software Technical Support Note # 15022