[Users] How to Log errors while executing ingres sql command
Paul White
pwhite at peerlessit.com.au
Sun Feb 19 21:20:22 PST 2006
Hi Ajay,
Check out the archives at info ingres. I believe someone will have done
this before.
To register
http://mailman.cariboulake.com/mailman/listinfo.py/info-ingres
or check out the news feed at comp.databases.ingres
Paul
________________________________
From: Ajay Dalvi [mailto:dalvi_ajay at <mailto:at at extenprise.net>
extenprise.net]
Sent: Monday, 20 February 2006 3:56 PM
To: users at ingres.ca.com; Paul White
Subject: RE: [Users] How to Log errors while executing ingres sql
command
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: users-bounces+pwhite=peerlessit.com.au at ingres.ca.com
[mailto:users-bounces+pwhite=peerlessit.com.au at ingres.ca.com
<mailto:users-bounces+pwhite=peerlessit.com.au at ingres.ca.com> ] On
Behalf
Of dalvi_ajay at extenprise.net
Sent: Monday, 20 February 2006 3:09 AM
To: users at ingres.ca.com
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
Users at ingres.ca.com
<http://ingres.ca.com/mailman/listinfo/users>
http://ingres.ca.com/mailman/listinfo/users
_______________________________________________
Users mailing list
Users at ingres.ca.com
<http://ingres.ca.com/mailman/listinfo/users>
http://ingres.ca.com/mailman/listinfo/users
--
This message has been scanned for viruses and
dangerous content by Extenprise mailscanner <http://www.extenprise.net/>
, and is
believed to be clean.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ingres.com/pipermail/users/attachments/20060220/56a90106/attachment.html
More information about the Users
mailing list