473,382 Members | 1,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Get the second line of an error message from Oracle db in perl

154 100+
This is part of the perl script.

Basically i want to try and get the second line of the error message.
Now the whole error which is 5 lines long will come up if i use $Errormsg
So basically i just want the second line of $errormsg to print is this possible?

Expand|Select|Wrap|Line Numbers
  1. select TRIM(ed.created_date) Created_Date,
  2.            TRIM(ed.ERRORMSG) ErrorMsg,
  3.            to_char(substr(eventdata,instr(eventdata,'<ns0:SiteContractNumber>')+24,
  4.                 instr(eventdata,'</ns0:SiteContractNumber>') - instr(eventdata,
  5.                 '<ns0:SiteContractNumber>')-24)) SiteContractNumber,
  6.        to_char(substr(eventdata,instr(eventdata,'<ns0:ContactNumber>')+19,
  7.             instr(eventdata,'</ns0:ContactNumber>') - instr(eventdata,
  8.             '<ns0:ContactNumber>')-19)) ContactNumber,
  9.        to_char(substr(eventdata,instr(eventdata,'<ns0:LineItemNumber>')+20,
  10.             instr(eventdata,'</ns0:peekaboo>') - instr(eventdata,
  11.             '<ns0:peekaboo>')-20)) LineItemNumber
  12.    from exception e, exception_detail ed
  13.     where e.jmsid = ed.jmsid
  14.       and trunc(e.timeoccured) = (sysdate)
  15.       and (upper(projectname) like '%BOOBOODEE%')
  16.  
  17.  
  18. $sth = $hisCon->prepare( $zuluSQL);
  19. $sth->execute();
  20.  
  21.  
  22. while( $sth->fetch() ) {
  23.  
  24.       $sth->bind_columns(\$Created_Date, \$ErrorMsg, \$SiteContractNumber, \$ContactNumber, \$LineItemNumber);
  25.    if ($SiteContractNumber != null) {    
  26.  
  27.  
  28.    if ($ErrorMsg =~ /Data not found : Product Info -/) {
  29.  
  30.       $recLine = " ".$SiteContractNumber." ".$LineItemNumber."\t".$Created_Date."\t"."Product Not Found:  ";
  31.       writeLogFile($logFile, $recLine .  "\n");}  
  32.  
  33.  else {
  34.        $recLine = " ".$SiteContractNumber." ".$LineItemNumber."\t".$Created_Date."\t"."Site Contract Not Found:  ".$SiteContractNumber;
  35.        writeLogFile($logFile, $recLine .  "\n"); }      
  36.        }
  37.  }
Jan 10 '07 #1
0 1143

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: MrTrix | last post by:
Hello: I'm having a problem formulating the code to execute a multiple line command. I'm trying to execute something like: set rowcount 100000 declare @rowct int select @rowct = 1 while...
1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
1
by: ulloa | last post by:
Hi. My name is Randall and I am from Costa Rica. I have a little problem. I did an application using Perl, DBI and DBI::Oracle, and now I have to upload my application in an Unix server. The...
1
by: Axel Dachtler | last post by:
Hello, I want write a CGI-script in Perl to execute queries in an Oracle 9i database. But I don't know which Drivers (or Perl-moduls) to load and how! Thanks Axel
125
by: Rhino | last post by:
One of my friends, Scott, is a consultant who doesn't currently have newsgroup access so I am asking these questions for him. I'll be telling him how to monitor the answers via Google Newsgroup...
1
by: Cern | last post by:
Is it somebody out there who has made a migration from an Oracle server to an MySQL server?? The scenario is as simply: I've got a Oracle 8 server with a database with content that I want to...
6
by: Raul Rodriguez | last post by:
I posted this question already but nobody could answer me. Please forgive for doing it again, but it's very important for my company. We have been searching for this error with different engines...
20
by: antonberg1 | last post by:
Hi, I wonder if it is possible to write a platform independent c-application running as job on a sun solaris multiprocessor machine, connecting to an oracle database and creating a very simple...
2
by: Mark Cummings | last post by:
I am migrating an Oracle 9i to Oracle 10g database, and Perl 5.0.4 to Perl 5.8.7 in Sun Solaris environment. Using Perl 5.8.7, the following legacy code segment is returning a '-1' return code on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.