Re: output to terminal with SQL
Posted in 1998
Albert Geisser wrote:
> Is it possible to output any status information with SQL.
> (something like a 'echo' on bourne shell)
> If yes how?
Well, it depends on what you're looking for... DB-Access emits
comments like 'table created' anyway, reporting errors when it runs
into them. But it continues regardless. You can also do things like
dbaccess somedb - <<EOF
!date
update sometable set somecol = 37000 where someothercol < 1;!date
EOF
This will run the Unix date command before and after the UPDATE
statement. By extension, you can also run the Unix echo command too.
If you want more control, consider SQLCMD from the IIUG archives,
which I wrote so this is not an unbiassed recommendation. It has
a built-in echo command; it also has *slightly* more sophisticated
control over errors -- you can control whether the script continues
or stops after an error (instead of having to continue). Not very
much better, but somewhat better.
--
Yours,
Jonathan Leffler (jleffler@informix.com aka jleffler@earthlink.net)
#include <far-too-many-aliases.h>
#include <guardian-of-DBD::Informix.h>
#include <disclaimer.h>