CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
How to check Oracle error in select sub

 



digioleg54
User

Mar 6, 2017, 8:35 AM

Post #1 of 1 (1230 views)
How to check Oracle error in select sub Can't Post

I have a sub below. Do I have to check error and how?

Code
sub get_processing_date 
{
print "Check Today's date in the database";
my $dbh = DBI->connect('dbi:Oracle:host= ; sid=ORCL;port=',$user_id,$passwd, {RaiseError => 1, AutoCommit => 0 });

my $sql="SELECT TO_CHAR(parameter_date),'YYYYMMDD') FROM dte_parameter where parameter_name = 'DTE_PROCESSING_DATE';";
my $sth = $dbh->prepare($sql);
$sth->execute();
while (my $Today = $sth->fetchrow_array) {
print "DTE PROCESSING DATE IS $Today\n";
}
return $Today;
}



(This post was edited by FishMonger on Mar 6, 2017, 12:26 PM)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives