Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: metaperl [...] urth.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.28
Fixed in: (no value)



Subject: type info not numerical
Download (untitled) / with headers
text/plain 1013b
This program shows that DBD::SQLite returns unuseable type info. I would appreciate any pointers on where to go to fix this. It looks like one just needs to write a mapper of some sort: my %type_conv = ( 'CHAR' => 1, 'INT' => 4 ); But the problem is figuring out how DBD::SQLite services the $sth->FETCH('TYPE') call from DBI. ~/hacks/dbirs $ perl tryselect.pl sqlite INT CHAR(20) INT CHAR(20) at tryselect.pl line 26. ~/hacks/dbirs $ perl tryselect.pl pg 4 1 4 1 at tryselect.pl line 26. ~/hacks/dbirs $ cat tryselect.pl use DBI; use DBD::SQLite; my %dsn = ( sqlite => 'dbi:SQLite:test.db', pg => 'dbi:Pg:dbname=test' ) ; my $dsn_key = shift or die 'must supply dsn key'; my $dsn = $dsn{$dsn_key} or die "$dsn_key not found"; my $dbh = DBI->connect ($dsn, undef, undef, { RaiseError => 1 } ); my $tbl = 'dbixrs1'; my $sql = "SELECT * FROM $tbl WHERE 1=0" ; $sth = $dbh->prepare($sql); $sth->execute; my $type = $sth->FETCH('TYPE'); warn "@$type";
Download tryselect.pl
text/x-perl 455b
use DBI; use DBD::SQLite; my %dsn = ( sqlite => 'dbi:SQLite:test.db', pg => 'dbi:Pg:dbname=test' ) ; my $dsn_key = shift or die 'must supply dsn key'; my $dsn = $dsn{$dsn_key} or die "$dsn_key not found"; my $dbh = DBI->connect ($dsn, undef, undef, { RaiseError => 1 } ); my $tbl = 'dbixrs1'; my $sql = "SELECT * FROM $tbl WHERE 1=0" ; $sth = $dbh->prepare($sql); $sth->execute; my $type = $sth->FETCH('TYPE'); warn "@$type";


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.