473,770 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

154 New Member
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 1171

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

Similar topics

8
11750
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 (@rowct > 0) begin
1
14158
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 uninitialized value in concatenation (.) at register.pl line 38, <STDIN> line 10." The PERL code is as follows:
1
4150
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 problem is that the server doesn't have DBI and DBI::Oracle packages and the owner's server doesn't want to install the packages because he thinks that the installation will change the server configuration, and that server has a lot of web...
1
2179
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
15510
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 searches. Scott has heard a lot of hype about DB2 and Oracle and is trying to understand the pros and cons of each product. I'm quite familiar with DB2 but have never used Oracle so I can't make any meaningful comparisons for him. He does not have...
1
2559
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 transfer to a MySQL database. No special data, constraints etc that MySQL not will handle. My solution is to reverse engineer the database from ERStudio and then produce a SQL script that will insert the data into the MySQL engine. But I can't do...
6
2094
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 (Google, MSN, etc) and in different newsgroups but we didn't find any solution. Some people had the same problem but they never got an answer. :-( This managed group is my last chance! We have a "legacy" ASP application that is showing a...
20
2747
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 xml-file from the data extracted. Could you maybe give me some advice where to start reading about that theme? Usually I develope windows applications, but this time my software has to run on sun solaris.
2
4077
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 the system call to execute the 'mv' command. Note that the mv request is across directories. sub move_inproc { print "sub move_inproc\n"; `mv $histhome/dat/inbound/$filename $histhome/dat/inproc/$filename`; if ($? !=0) {
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.