Sunteți pe pagina 1din 2

Cross Referencing Tables and Forms Used by a Form [Back] Here is a unix script, formtables.

shl, which shows which tables are used by the given Oracle form, and how they are used (Select or List of values (LOV), Update, Insert, Delete, o r undetermined), which can be used on .fmb (form) and .pll (library) files. It parses the strin gs in the form file, and makes a best guess effort in determining the tables used by the form, match ing the string patterns against a file listing the non-system tables in the database (generate d by formtables.sql). Since it doesn't analyze the code or trace through the function calls in the at tached libraries, or look at database triggers for side effects of table changes, it may not find some table references, but, it does a pretty good job on most form files. For Banner use rs, it also shows which forms are called by this form, including form access (query only, e tc.). You will first need to run formtables.sql from sqlplus (using @formtables.sql), logging in as SYS or SYSTEM or as a DBA userid, to generate the list of non-system tables in the database that will be matched by your formtables.shl runs. (Note: You should also run formtables. sql after at least installing each major upgrade in Banner, such as 3.x to 4.x, and possibly minor upgrades as well, to keep the table list current.) You may want to edit the resulting formtables.tables file to get rid of any non -Banner tables. After generating the table listing, you can then run formtables.shl on a form-by-form basis as needed, or on an entire directory of forms using the unix find command. Both of those ways are shown below (the lines with and following the find command must be all on one line when you type it in; make sure you do a "chmod 755 formtables.shl" in unix before using the script): formtables.shl $BANNER_HOME/<product>/forms/<formname>.fmb find $BANNER_HOME/<product>/forms -name '*.fmb' -exec formtables.shl {} \; Another Banner-specific unix script, formcalls.shl, recursively finds all forms which are called by the given form, showing the list of all forms, a pruned tree of called forms, and the complete list of forms with their subforms, including access switches (query only, etc.). This information can be used in tasks such as developing the list of forms for a class when you're only given a few top-level form names for that class. Note that it requires that all forms and subforms must be in o r linked in the $BANNER_LINKS directory. Also, be aware that it will not find calls to generated form names, such as those generated by Banner LIST_VALUES_CA LL triggers. Because of the large amount of output produced for some forms, such as the employee information screen with all of its subscreens, you should probably only run this on a form-by-form basis as needed, as shown below (also do a "chmod 755 formcalls.shl" in unix before using the sc ript): formcalls.shl $BANNER_LINKS/<formname>.fmb

This could be used to find the list of forms called by a set of forms by creating a unix shell script similar to the following (which could take a long time to run, depending on how many forms had to be recu rsed through): rm fcalls.out formcalls.shl $BANNER_LINKS/form1.fmb cat fcall.out >>fcalls.out formcalls.shl $BANNER_LINKS/form2.fmb cat fcall.out >>fcalls.out ... (pairs of lines like above for each form in the set of forms) sort fcalls.out | uniq >fcall.out cat fcall.out Modified versions of the formtables scripts, collector.shl and collector.sql, are available to identify just the list of forms which reference Banner collector tables (or any given set of tables). The collector.shl script would be run using the "find" command (after first run ning collector.sql), similar to the formtables scripts: find $BANNER_HOME/<product>/forms -name '*.fmb' -exec collector.shl {} \; If you want to find which forms contain a given string, use the formgrep.shl unix script (certainly not to be confused with FormGrep from August Tenth System s, Inc.!), calling it with the form name and string to search for, such as searching for sh rcomc in all forms in the $BANNER_LINKS directory: find $BANNER_LINKS -name '*.fmb' -exec formgrep.shl {} shrcomc -1 \; The optional third parameter to formgrep.shl indicates how many lines to show: -1 for no lines (just the file name if it matches), 0 for just the matching line (the default), or greater than zero for the number of lines before and after the matching line to also show. If you show matching lines, you may need to wade through the junk lines to find what you want. To show which tables are updated by the given Pro-C (*.pc) or Pro-COBOL (*.pco) program, and how they are used (Update, Insert, Delete), you can use the progtables.shl script. To find the tables in all of the Focus programs (*.fex) in the current directory, you can use the foctables.shl script. Run formtables.sql first before doing any progtables.shl or foctables.shl runs. (Note: We no longer use Focus, so this foctables.shl is my final version of it. )