Re: SQL from command line capturing screen display.
Posted in 1997
Terron Wright wrote:
>
> How can I capture what is displayed to the screen when doing dbaccess
> script from the command
> line in UNIX. I would like to be able to capture the 100 records updated
> display.
You can run dbaccess in command line mode under script or redirect
output. To access command line mode follow the database name with a
dash (optionally -e echos inputs):
dbaccess -e mydatabase - <<eoinput >logfile 2>&1select count(*) from mytable where col1 = 12;
update mytable set col2 = 9 where col1 = 12;eoinput
-or-
dbaccess -e mydatabase - <myscript.sql >logfile 2>&1
Either of these will continue past any errors. To stop on an error
replace the dash in the second version with the script name:
dbaccess -e mydatabase myscript.sql >logfile 2>&1Art S. Kagel