Hi Paul,
        First of all Thanks for your reply.
I am still having one problem.  I have to actually log the full error description. As in your case, the output of the sql command will be in mylog file, but it will contain other statements apart from errors, but I want to log only error messages.
Grrepping E_ will be usefull only if the error description is of one line.
If error description is more than one line for e.g.

E_XF0019 There was a table or view specified on the command line that does
    not  exist or is not owned by you, or has been supplied more than once.


In this case, If we grep it using E_ then we will get only first line.
For this I am trying to create regular _expression_ which wll grep error msg with multiple lines description.
If you can provide some help for this, it will be helpfull for me.

-Ajay


On Sun, 2006-02-19 at 22:49, Paul White wrote:
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

--
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

Reply via email to