Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
ifx_tables.pl | 2020-05-11 | 6.9 kB | |
README | 2020-05-11 | 2.9 kB | |
Totals: 2 Items | 9.7 kB | 0 |
DESCRIPTION: This script analyses .4gi files and outputs a 99.87% accurate listing of the tables used by the program, and whether they get SELECT INSERT DELETE UPDATE operations applied to them. Perverse and deliberately twisted string construction methods in the .4gl file (string constr- uction for PREPARE and DECLARE statements) can confuse the process, but I've found that programmers tend to build strings from the left to the right. If yours don't, then I can't help you;-) This program can be useful in two situations: when you don't have the source code for a 4GL executable, or when you do not have rock- solid procedures in place for programmers to document table usage in a program. We have built a call to this script into our program build scripts. Every time a programmer produces an executable, it automagically lists the tables used what happens to them. In 3 different applications with between 800 and 1600 individual programs, you should be able to see how useful this is when we need to make table changes... INSTALLATION: Installation is trivial - just put ifx.tables into your favourite bin directory. PLEASE leave the Copyright and Author lines in place. It's only good manners. The README file can go anywhere including /dev/null USAGE: ifx.tables [-fls] [-F] fname.4gi ... where -f list individual 4gl files -l list by locale - ie library or local filename -s summary by table -F no warning about missing filelist.RDS (FourGen concept) NOTE: if you don't know what kind of curse-word "filelist.RDS" is, then you will always want to run it with the -F flag. HOW IT WORKS: This program uses the strings utility of UNIX to extract the strings compiled into the 4GI. Amongst other things, this includes the strings used to build all SQL statements (nothing escapes!) and also all the strings used by programmers to build prepared statements and cursors. The other key string written into the .4gi file is the name of the individual .4gl files which constitute the program. The output from strings is analysed by this script. Even strings which are constructed piece by piece can almost always be trapped: the script uses a simple finite state machine to track the pieces. DEPENDENCIES: This script relies on plain vanilla Perl. It was originally written for Perl version 4, then migrated to Perl 5. Current version in use is Perl 5.6. The script is so straight-forward that I can't imagine any future versions of Perl causing any trouble, although I've noticed that the warnings get progressively more paranoid and fussy as new versions of Perl are released. If you get any spurious warnings with a new version of Perl, then remove the -w from the first line of the script. The warnings will be wrnog wrnog wrnog! Andrew Hamm Sanderson Australia Pty Limited -- Just another 4GL hacker.