Pisql-2.0
Posted in 1993
Now available, version 2 of pisql, an isqlperl script that permits you to enter adhoc sql queries if you are stuck without a copy of isql itself. Prerequisites: 1. An Informix Engine, either SE or Online, V4.00 or upwards 2. Informix ESQL/C or Informix/4GL (Compiler) 3. Perl 4. isqlperl extensions Informix products are available from your usual suppliers, perl is available from a number of sources, isqlperl is available from: ftp.demon.co.uk:/pub/perl/db/isqlperl pisql-2.0 is available from: ftp.demon.co.uk:/pub/perl/db/isqlperl/contrib Considerable effort has been spent ensuring queries like: select patient.number pnum, surname, fname, dob, invest.number inum, i_date, code from patient, invest where invest.pnox = patient.number will display correctly. I've thrown a number of complex queries at it and they all seem to work. Doubtless, someone will find one that doesn't. In writing this, I've learnt quite a bit about Perl in general, a smattering more UNIX programming, and a bit about Informix system table structures. Only systables and syscolumns are supported by this release, no effort has been spent dealing with views or synonyms because I don't have any. Version 2 now permits for the saving, loading and editing of scripts and for command lines of the form: pisql database script As with isql, a - is allowed if a database statement is the first statement in the script and the script argument should not contain the .sql suffix, although the file name itself must. Its been tested with SE v 4.00 on a Sun 3/60, SunOS 4.1.1 and SE v 4.10 on a Sparc 4/330, SunOS 4.1.2. Supported environment variables: PAGER The specified pager will be started if this is set. Otherwise the default pager is 'more'. DBDATE If you don't have DBDATE set, then the system will assume a DBDATE of DMY2/ and set it's environment accordingly. DBPRINTER If this is set, then output is piped to whatever the value of this is when you specify output to the printer. Otherwise, lpr is assumed. DBPATH All directories named herein are searched for .sql scripts, otherwise, just the current directory is searched. DBTEMP The place where a file is created when a script is being edited. The default is /tmp DBEDIT The editor to use to edit scripts. The default is vi, despite the fact that the author believes that if you are smart enough to have Perl, you'll be smart enough to have Emacs. I welcome comments on the scripts usefulness, bug reports, requests for additions (I will be adding command line and script facilities) and constructive comments on my Perl programming style. :-) I'd also like to know if this works with the Online engine. The script is provided as is, in the hopes that someone will find it useful. The license which you got with isqlperl applies equally to this script. There is nothing like *having* to write a script to get you to learn a language. Acknowledgements Informix Inc. Whose engines still do all the work Larry Wall for writing Perl William Hails for writing the isqlperl extensions Enjoy. Regards Neil -- Neil S. Briscoe Telephone: +44 252 376737 System Administrator Fax: +44 252 376644 Email: neil@salmon.demon.co.uk nbriscoe@cix.compulink.co.uk