CC: | "bug-DBD-Sybase [...] rt.cpan.org" <bug-DBD-Sybase [...] rt.cpan.org> |
Subject: | client-side placeholders in DBD::Sybase prepared statements |
Date: | Wed, 4 Aug 2010 19:19:04 -0500 |
To: | "mpeppler [...] peppler.org" <mpeppler [...] peppler.org> |
From: | "Nicol, David" <DNichols [...] kgptel.com> |
Please enjoy the attached file. I do not know how severely it violates DBD coding standards. I imagine a similar approach could be provided more elegantly where placeholders are currently translated into TSQL stored procedures, instead of at the top of the existing prepare method. The following now DWIW, which is to have the rows method work after running an UPDATE prepared with placeholders.
print "STATEMENT WITH INLINE DATA:\n";
my $sth = $dbh->prepare(<<UPDATE3);
update dln_demotable set first = 'Z' where second < 'd'
UPDATE3
print "updating three rows, got result: ".$sth->execute()."\n";
print "rows method tells us: ",$sth->rows()."\n";
print "STATEMENT WITH PLACEHOLDER:\n";
my $sth = $dbh->prepare(<<UPDATE3);
update dln_demotable set first = 'X' where second < ?
UPDATE3
print "updating three rows, got result: ".$sth->execute('d')."\n";
print "rows method tells us: ",$sth->rows()."\n";
Message body is not shown because sender requested not to inline it.