Re: dbaccess: the only SQL option?!
Posted in 1997
If you create an SQL text file, you can run it with dbaccess by doing:
$ dbaccess <database> <sql-file>
This will run the SQL command without firing up the menu interface. Note,
however, that all the statements will run, even if some in the middle fail.
For example, if you run this batch that way:
BEGIN WORK;
INSERT INTO history
SELECT *
FROM current
WHERE month = 11;
DELETE FROM current
WHERE month = 11; COMMIT WORK;
If the INSERT statement fails, the DELETE statement still executes, as does
the commit work. This could be very bad. This behavior can be changed by
setting an undocumented (to my knowledge) environmental variable,
DBACCESSNOIGN=1.
As for error messages, if you get an error like "-216" do this:
$ finderr -216
...and Informix will pull up a detailed description of your error.
Al Wang <alwang@NOSPAMdoubt.com> wrote in article
<346f9075.37258809@netnews.upenn.edu>...
> Hi,
>
> I've just recently begun to play around with Informix Universal
> Server, and while I am very impressed with the technology under the
> hood, I'm kind of dismayed by the interface, in terms of database
> creation: is the only way to enter SQL statements through dbaccess's
> menu system? This seems horribly inefficient. Is there no sort of
> command-line SQL parser like for Oracle? Are there no online help
> features? Can the SQL error messages be any less helpful?
>
> I'm probably just missing the boat entirely on how to do this stuff
> effectively, so I'd appreciate it if someone could set me straight.
>
> Thanks,
> Al
>
> Al Wang
> http://www.seas.upenn.edu/~alwang
> remove NOSPAM to reply
>