Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Retrieving current statement with $dbh->errstr
Date: Mar 12 2004 3:49PM

On Fri, 2004-03-12 at 07:44, Mark Sutfin wrote:
> I'm migrating all of our ksh scripts to perl. I'm new to DBI. I'm
> testing it to see if it'll work for all of the existing db access
> currently found in our ksh scripts.
> If there's a better place to post this question, thanks in advance for
> the direction.
> I'd like the current sql statement to display in my logfile. So for
> each statement, I'd like to assign this to a variable before/after
> execute. Is there a way to use this driver-specific database handle
> attribute to return the sql statement regardless of error?

I believe that you can use $sth->{Statement} to get at the SQL statement
for the current statement handle.

Michael Peppler                              Data Migrations, Inc.             
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or 
long term contract positions -