05-07-2009
Thanks for that man...
but Iguess that was not a good example. Basically I want to capture the description of the error along with the error and count how many times it occurred.
I want to capture the part in bold
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0204N "ITUAM.VW_TT_VALUES" is an undefined name.
SQLSTATE=42704
blah blah blah....
[blank line] <-all the information upto this blank line and then how many times it appears in the file
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
I get this error message after I pipe a lot of output into grep. Does anyone know what his means?
grep: writing output: Invalid argument
thanks,
gammaman (3 Replies)
Discussion started by: gammaman
3 Replies
2. Solaris
Hello...
I'm trying to run the sshd script, but I keep geting the Syntax errot message .
Here's the last few lines on the script. set nu in vi shows 58 lines, but I keep getting error referring to line 59. Any help is appreciated.
Thanks,
Remi
else
echo... (4 Replies)
Discussion started by: Remi
4 Replies
3. UNIX for Advanced & Expert Users
My file creates an output log after which includes a few sql queries.
I segregate them into warnings and errors and then get a total count.
The errors' and warnings' lines always start with SQL{4} followed by the details of the error.
This is what im doing as o now...
errors=`grep -A 1 -E... (1 Reply)
Discussion started by: VGR
1 Replies
4. Shell Programming and Scripting
Hi Folks,
I got to know from this forums on how to grep from a particular line say line 6
awk 'NR==6 {print;exit}'
But how do i grep from line 6 till the end of the file or command output.
Thanks, (3 Replies)
Discussion started by: Mr. Zer0
3 Replies
5. Shell Programming and Scripting
Does anyone know how to use awk to act like grep from a particular line number to the end of file? I am using Solaris 10 and I don't have any GNU products installed.
Say I want to print all occurrences of red starting at line 3 to the end of file.
EXAMPLE FILE:
red
green
red
red... (1 Reply)
Discussion started by: thibodc
1 Replies
6. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
#/bin/sh -xv
#Author: Lauren Buecker
#Date: September 28 2012
#Class COP3353
#Assignment: Assignment 4... (7 Replies)
Discussion started by: swimmerbhs
7 Replies
7. UNIX for Dummies Questions & Answers
I'm trying to grep lines where the digits at the end of each line are greater than digits. Tried this but it will only allow me to specify 2 digits. Any ideas would greatly be appreciated. grep -i '\<\{3,4,5\}\>' file
---------- Post updated at 05:58 PM ---------- Previous update was at 05:41... (1 Reply)
Discussion started by: jimmyf
1 Replies
8. Shell Programming and Scripting
Cat file1
--------
----------
SCHEMA.TABLE1
insert-------
update-----
-------------
----------
SCHEMA.TABLE2
insert-------
update-----
-----------
------------
SCHEMA.TABLE3
insert-------
update-----
------------
grep -n SCHEMA > header_file2.txt (2 Replies)
Discussion started by: Veera_V
2 Replies
9. SCO
In COBOL, a hyphen can be used in a field name and in a specific program some field names would be identical to others except a suffix was added--sometimes a suffix to a suffix was used. For example, assume I am looking for AAA, AAA-BBB, and AAA-BBB-CCC and don't want to look at AAA-BBB-CCC... (7 Replies)
Discussion started by: wbport
7 Replies
10. Shell Programming and Scripting
Hi,
i need to cat a file after # till the end of the file
usually ill do cat /etc/somthing | grep -A999999 #
but its not that professional
thanks
edit by bakunin: please use CODE-tags (or ICODE-tags) for code and data. Thank you. (9 Replies)
Discussion started by: batchenr
9 Replies
LEARN ABOUT PHP
db2_conn_error
DB2_CONN_ERROR(3) 1 DB2_CONN_ERROR(3)
db2_conn_error - Returns a string containing the SQLSTATE returned by the last connection attempt
SYNOPSIS
string db2_conn_error ([resource $connection])
DESCRIPTION
db2_conn_error(3) returns an SQLSTATE value representing the reason the last attempt to connect to a database failed. As db2_connect(3)
returns FALSE in the event of a failed connection attempt, you do not pass any parameters to db2_conn_error(3) to retrieve the SQLSTATE
value.
If, however, the connection was successful but becomes invalid over time, you can pass the $connection parameter to retrieve the SQLSTATE
value for a specific connection.
To learn what the SQLSTATE value means, you can issue the following command at a DB2 Command Line Processor prompt: db2 '? $sqlstate-
value'. You can also call db2_conn_errormsg(3) to retrieve an explicit error message and the associated SQLCODE value.
PARAMETERS
o $connection
- A connection resource associated with a connection that initially succeeded, but which over time became invalid.
RETURN VALUES
Returns the SQLSTATE value resulting from a failed connection attempt. Returns an empty string if there is no error associated with the
last connection attempt.
EXAMPLES
Example #1
Retrieving an SQLSTATE value for a failed connection attempt
The following example demonstrates how to return an SQLSTATE value after deliberately passing invalid parameters to db2_connect(3).
<?php
$conn = db2_connect('badname', 'baduser', 'badpassword');
if (!$conn) {
print "SQLSTATE value: " . db2_conn_error();
}
?>
The above example will output:
SQLSTATE value: 08001
SEE ALSO
db2_conn_errormsg(3), db2_connect(3), db2_stmt_error(3), db2_stmt_errormsg(3).
PHP Documentation Group DB2_CONN_ERROR(3)