Kbase P122631: To which table name did the Progress Compiler resolve an unqualified field name?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  04/11/2008 |
|
Status: Verified
GOAL:
To which table name did the Progress Compiler resolve an unqualified field name?
GOAL:
Is there a way to identify where in the code do the unqualified field names occur?
GOAL:
How does the 4GL / ABL compiler resolve table names of unqualified field names?
FIX:
1. Compiling 4GL or ABL code using the XREF option generates a listing where all field references are fully qualified with the table and database name. For example the statement:
COMPILE myProcedure.p XREF myProcedure.XREF.
generates a the file myProcedure.XREF where all fields references occurring in the code are fully qualified.
2. No, there is no way to to identify where in the code unqualified field names occur except by comparing, manually or a programmatically, the source code with its XREF listing.
3. The PROGRESS compiler uses the context to help qualify an unqualified field name. It first looks to see if it is a program variable. If it is not, then it sends out a request to all the attached databases for any partial or exact match on that name in any table. It gets back a list of table/field pairs and matches them against its current environment, starting with the innermost block it is forming. If it can get an unambiguous match with a table in the current block, it will pick it. If not it moves out to the next enclosing block and so on. Eventually it may give up and issue error message like "** <field> is ambiguous with <table>.<field> and <table>.<field> (72)" or "** Unknown Field or Variable name - <field>. (201)" or "** Missing FOR, FIND or CREATE for a table with cat in current block. (232)". If it finds an unambiguous match, partial or otherwise, then that field is used to resolve the reference.
4. Progress does not offer any XREF / STRING-XREF parsing tools. However, the third party "XREF Parser" application is available as a free download from PSDN Code Share. This tool takes an XREF / STRING-XREF pair of files and returns several informational Temp-Tables that include: A Temp-Table of all information on each XREF line in a standardized format, a TEMP-TABLE of all programs / files referenced in the compilation, a TEMP-TABLE of all database tables, temp-tables and worktables referenced in the file(s), and how they're used (i.e. create, update, delete, access, etc.) among other useful information.