Hello Ajay,
Here's what I do in a unix script.

sql mydb <<eof > mylog
Select stuff...
\g
eof

grep "E_" mylog > /dev/null
if [ $? -eq 0 ] ; then
        echo "Error occurred"
        exit 1
fi


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of [EMAIL PROTECTED]
Sent: Monday, 20 February 2006 3:09 AM
To: [email protected]
Subject: [Users] How to Log errors while executing ingres sql command

Hi all,
        I am using ingres sql command to execute the sql commands
(create/insert/delete), While executing ingres 'sql' command, all the
errors that raises gets displayed on standard output with error number
in format E_<>.

On linux, I am executing this comand through shell script. I want to log
the errors which raises by sql, I have tried this by following way:

        sql database_name < sql_file   2>> log_file

But the errors are not getting logged in to specified log file.

Just for comparision, in postgres database, we can do this as

        psql database_name -f  sql_file 2>>log_file.

In this case , errors gets logged properly in specified log file.

So can any one please tell me how I can achieve the same behaviour in
ingres.

-Ajay


--
This message has been scanned for viruses and dangerous content by
Extenprise mailscanner, and is believed to be clean.

_______________________________________________
Users mailing list
[email protected]
http://ingres.ca.com/mailman/listinfo/users

_______________________________________________
Users mailing list
[email protected]
http://ingres.ca.com/mailman/listinfo/users

Reply via email to