The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
hell and sqlite ogoy Shell Programming and Scripting 2 05-21-2008 01:07 AM
sqlite database in HP-UX vs Linux perlprg HP-UX 1 05-09-2007 03:56 AM
sqlite issue? brandan UNIX for Dummies Questions & Answers 0 07-23-2004 11:44 PM
Question about Perl SolidSnake Shell Programming and Scripting 5 06-10-2003 10:20 AM
Perl question Optimus_P Shell Programming and Scripting 2 08-17-2002 01:44 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-08-2008
garric garric is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 99
Perl - SQLite question

Hello All,

I am trying to write a Perl script that is using 'SQLite' as the application needs a very light weight Database. I wanted to know how to catch exceptions when I run queries in SQLite. Without this the Perl script comes to a halt everytime an exception occurs. Please help.

Regards,
Garric
  #2 (permalink)  
Old 04-08-2008
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
Are you using DBD::SQLite via DBI? And have you tried the "HandleError" attribute available in DBI?

DB - Database independent interface for Perl - search.cpan.org
  #3 (permalink)  
Old 04-09-2008
garric garric is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 99
Thanks for the documentation. I will go through it to see if I can use that.
  #4 (permalink)  
Old 04-09-2008
garric garric is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 99
Or can I do it in this manner?

eval
{
my $sth = $dbh->prepare("$qstr");
$sth->execute();
$sth->finish();
};
if ($@)
{
print "\nError with $host";
}
  #5 (permalink)  
Old 04-09-2008
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
Surely yes, if that's your preference.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0