Pisql
Posted in 1993
If you have a version 4.00 or 4.10 engine but don't have Informix/SQL you may be able to make use of pisql. Pisql is an isqlperl script that saves you having to write an isqlperl script every time you want to make an ad-hoc query. Prerequisites: An Informix V4.00 or later engine, Compiler Informix/4GL *or* Esql/c, Perl and the isqlperl extensions. You can get Perl from the usual places, you can get isqlperl from ftp.demon.co.uk:/pub/perl/db/isqlperl and you can get pisql-1.0 from the contrib sub-directory of the same source. Here is the README, and my hopes that someone finds it useful. Regards Neil If you are an Informix DB user, like me, then you have doubtless found William Hails <bill@tardis.co.uk> isqlperl very useful. If, however, you don't posess a copy of isql itself, you still have to write an isqlperl script whenever you have an adhoc query to perform. So, I sat down and wrote an isqlperl script that would allow me to enter and perform adhoc queries (you can also enter any other legal sql command, such as insert and update statements). At present, there are no command-line switches, and you can't save a query or re-load it, but these should be easy to add. I've been spending my time on making sure 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 now. Doubtless, someone will find one that it doesn't work with. 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. 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. 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 real work Larry Wall for writing Perl William Hails for the isqlperl extensions -- Neil S. Briscoe Telephone: +44 252 376737 System Administrator Fax: +44 252 376644 Email: neil@salmon.demon.co.uk nbriscoe@cix.compulink.co.uk