Skip Menu |

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 8414
Status: resolved
Priority: 0/
Queue: DBD-SQLite

Owner: Nobody in particular
Requestors: eric [...]

Bug Information
Severity: Important
Broken in: 1.07
Fixed in: (no value)

Subject: Problem binding OID
Download (untitled) / with headers
text/plain 469b
I recently upgraded to the latest version of the DBD::Sqlite module (1.07). Previously I was using .31. I noticed a descrepency with binding parameters to a prepare statement. For example: my $number=3; $dbh->prepare ('select * from category where OID=?';); $dbh->execute ($number); In verion .31 this worked and I got what I queried for. However in 1.07 it didn't work. I had to change my sql query to : $dbh->prepare ('select * from category where OID like ?';);
From: eric [...]
Download (untitled) / with headers
text/plain 645b
I have a bit more information. After some testing I found that OID is not treated as an Integer, rather than a varchar. This code works: use DBI qw(:sql_types); use DBD::SQLite; $dbh = DBI->connect("dbi:SQLite:dbname=knowledge.db","","") or die "DB Connect Error: $DBI::errstr\n"; $sth=$dbh->prepare('select count(*) as reccnt,* from category where oid=?;'); $sth->bind_param(1,0,SQL_VARCHAR); In addition you must now explicitly define integer fields in table creation if you want integer comparisons to work. This wasn't a problem with the old db format. I'm not sure if this is a DBD::SQLite problem or a change in how SQLite works...

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to