Re: How to "load" a table without getting screen messages
Posted in 1996
Kate said:
> I've posted to this group trying to find out how to suppress results of
> ISQL "queries" going to the screen. I have received a number of helpful
> answers re. redirecting to stderr and stdout. Unfortunately this cannot
> work. Puzzled as to why it didn't I called INFORMIX tech support. They
> confirmed that it cannot be done. Also that I cannot "LOAD" a table from
> a file using "LOAD" in ESQL as it is not supported.
>
> All I need to do is load a table from a file and to suppress any screen
> messages. Is there anyway of doing this, bearing in mind the messages
> cannot be redirected using UNIX redirect and that ESQL does not support
> the "LOAD" statement.
>
I just tried it out using dbaccess and redirecting the messages from
stdout and stderr. Load is not part of ESQL. However this does
work with dbaccess or isql.
The following is the command line I used:
lester@merlin >dbaccess stores7 load >log 2>&1
This sends all messages to the file log. You could replace log
with /dev/null and the messages would completely dispear. I wanted
a log to make sure they loaded.
This runs dbaccess using the stores7 database and the script load.sql.
The ">log" sends stdout to a file log and the "2>&1" sends stderr to
the log. The order you have these re-directs is important.
The following is a unix shell script that does the same.
#!/bin/sh
# Program: load.sh
dbaccess stores7 - >log 2>&1 <<EOF
load from item.uld insert into lkEOF
There is an articule I wrote on using SQL in shell scripts and it
discusses redirecting stderr and stdout. Its available at our user
group WWW site listed in my sig.
If you are still have problems with this please email or post one of your
scripts and the commands you are using and I will see if it can be fixed.
Regards - Lester
#############################################################################
# Lester Knutsen lester@access.digex.net #
# Advanced DataTools Corporation Voice: 703-256-0267 #
# Grant group privileges for Informix databases with DB Privileges #
# Visit our Web page: http://www.access.digex.net/~lester #
# Washington Area Informix User Group: http://www.access.digex.net/~waiug #
#############################################################################