Question Finding, Where This Table Is Created?

Osborne

Active Member
If the table is not being created dynamically, another possible option would be to use RCODE-INFO. From this you can get a list of tables that are used in compiled files (.r), and although it will not tell you what program created it hopefully it will reduce the programs to check. The following reads all .r files in a specified directory and reports the program if the table was used:
Code:
DEFINE VARIABLE vCount AS INTEGER NO-UNDO.
DEFINE VARIABLE vFileName AS CHARACTER NO-UNDO.
DEFINE VARIABLE vFileType AS CHARACTER NO-UNDO.
DEFINE VARIABLE vFullPath AS CHARACTER NO-UNDO.
DEFINE VARIABLE vTableList AS CHARACTER NO-UNDO.

DEFINE STREAM sImport.
DEFINE STREAM sExport.

OUTPUT STREAM sExport TO "C:\Temp\ProgsContainingTable.txt".

INPUT STREAM sImport FROM OS-DIR("C:\Progress\Progs").
REPEAT:
    IMPORT STREAM sImport vFileName vFullPath vFileType.
    IF INDEX(vFileType, "F") > 0 AND vFileName MATCHES "*~~.r" THEN DO:
       ASSIGN RCODE-INFO:FILE-NAME = vFullPath
              vTableList = RCODE-INFO:TABLE-LIST.
       IF vTableList MATCHES "*table_crb*" THEN
          PUT STREAM sExport vFileName SKIP.
    END.
END.
INPUT STREAM sImport CLOSE.
OUTPUT STREAM sExport CLOSE.
 
  • Like
Reactions: rzr

Osborne

Active Member
What version of Progress are you on? RCODE-INFO:TABLE-LIST is available in version 10 and thought it was also available for version 9? If not and you are earlier than version 10 then unfortunately this option is not available for you.
 

GregTomkins

Active Member
I believe none of these solutions will work if you use dynamic queries. To be "guaranteed" to catch "everything", you can use session triggers. You don't need to have, or to modify, your source code although you would need to add code to establish the triggers somewhere. Realistically, it may or may not be practical depending on your environment.
 

TomBascom

Curmudgeon
"grep" is THE prototypical UNIX tool. You'd have to have a very messed up install to lack it. Therefore I assume you must be running some horribly crippled environment such as Windows.

You have my sympathies.
 

TheMadDBA

Active Member
On windows there are thousands of ways to find the code (editors that allow you to search files, findstr, etc).

ABL2DB will tell you where the references are for all of your non dynamic code (and some for the dynamic ones). You could try searching and compiling with XREF, but that work has already been done for you by The Doctor.
 
Top