RE: Perl DBI::prepare Question. My head is sore from banging it against the wall. Can you help ease my pain?




-----Original Message-----
From: BAIER, ANTHONY (TONY), ATTSI [mailto:abaier@xxxxxxx]
Sent: Thursday, November 29, 2007 11:06 AM
To: STILWELL, DAVID B (DAVE), ATTLABS; dbi-users@xxxxxxxx
Subject: Perl DBI::prepare Question. My head is sore from banging it
against the wall. Can you help ease my pain?


Dave, DBI User Group,

[>>] ...

Issuing rollback() for database handle being DESTROY'd without explicit
disconn
ct(), <REPORTFILE> line 319.

[>>]
Well right off hand I don't see it but can suggest (from past
experience!) that you use placeholders ... or at the least change the
quote style... qq{insert ... some quoted '$string'}...

The placeholders made my life much easier...

Example...

$sql = 'insert ... values (?,?,?,?,?)'
....
$sth = $dbh->prepare($sql) or die DBI->errstr;
$rc = $sth->execute($reportId, $queryNumber,$readCount, $execCount,
$queryText);


Hope this gives you some ideas...

jwm

.