Re**2: piping scripts into isql: bang escapes
Posted in 1992
Path: emory!swrinde!cs.utexas.edu!uunet!gossip.pyramid.com!pyramid!infmx!news
From: cortesi@informix.com (David Cortesi)
Newsgroups: comp.databases.informix
Message-ID: <1992Jan14.163521.29230@informix.com>
Date: 14 Jan 92 16:35:21 GMT
References: <1992Jan13.193649.15202@informix.com>
Sender: news@informix.com (Usenet News)
Reply-To: cortesi@informix.com
Organization: Informix Software, Inc.
> first off, jjamison@bellahs.UUCP (John Jamison) asked,
I am told there is an undocumented flag for isql that
allows you to pipe in an sql script into isql...Can anybody give me the name?
> I responded that "isql <database> -" would do it and gave this example:
isql stores - <<eot!
select * from systables where tabid > 99; eot!
> Jamison wasn't satisfied...
I am told there is an undocumented flag which presents
you with a ">" prompt or something, sort of a back door into isql
in which you don't have all the menus and special keys, etc.
> and rightly so, as Craig Browning pointed out...
The "isql - -" command Dave Cortesi mentioned will give you the ">" prompt
to work with in an interactive session.
A session could look something like this:
% isql - -
> database stores;Database selected.
> select * from customer;etc.
That was news to us here in tech pubs [of course it came AFTER the
5.0 manuals went to press :-( ] but even more interesting news came
today. When operating in piped mode this way, ISQL will accept an
initial "!" as meaning escape to shell. Here is how it looks
using 4.1 software on a Sun:
[gort 7] isql stores -
> select avg(customer_num) from customer
where fname matches "[A-G]*";
>
(avg)
115.06
1 row(s) retrieved.
> !echo hello from the shell
hello from the shell
> ^D