Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: raklet [...] gmail.com
Cc:
AdminCc:

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



Subject: prepare failed: ambiguous column name at dbdimp.c
OS: Windows XP Service Pack 2 Perl Version: ActivePerl 5.8.3.809 Module Version: DBD-SQLite 1.07 for Windows via Active State PPM. DB Version: $dbh->{sqlite_version} returns 3.0.7 Schema for table I am trying to query: CREATE TABLE field ( id integer primary key, name varchar(255), area int(11), soil_type varchar(255), description text, comments text, farm_id int(11) ); Code snippet: my $dbh = &dsn(); my $select = $dbh->prepare( qq { select field.id, field.name, field.area, field.soil_type, field.description, field.comments, field.farm_id from field, farm where field.farm_id=farm.id and farm.id=? order by $by $order }); $select->execute(); Running this code gives the following error message: DBD::SQLite::db prepare failed: ambiguous column name: name(1) at dbdimp.c line 263 at /DB.pm line 228. If I type the exact same query into an SQLite3 (3.0.8) command line, it executes successfully. Tyler Hepworth
[guest - Thu Dec 30 15:08:10 2004]: Show quoted text
> OS: Windows XP Service Pack 2 > Perl Version: ActivePerl 5.8.3.809 > Module Version: DBD-SQLite 1.07 for Windows via Active State PPM. > DB Version: $dbh->{sqlite_version} returns 3.0.7 > > Schema for table I am trying to query: > > CREATE TABLE field ( > id integer primary key, > name varchar(255), > area int(11), > soil_type varchar(255), > description text, > comments text, > farm_id int(11) > ); > > Code snippet: > > my $dbh = &dsn(); > my $select = $dbh->prepare( qq { select field.id, field.name, > field.area, field.soil_type, field.description, > field.comments, field.farm_id > from field, farm where field.farm_id=farm.id > and farm.id=? order by $by $order }); > $select->execute(); > > Running this code gives the following error message: > > DBD::SQLite::db prepare failed: ambiguous column name: name(1) at > dbdimp.c line 263 at /DB.pm line 228. > > If I type the exact same query into an SQLite3 (3.0.8) command line, > it executes successfully. > > Tyler Hepworth
Nevermind. Please delete this report (not a bug). The value of $by was 'name' instead of 'field.name' - hence "ambiguous column name". I didn't realize this at first because MySQL would process this exact same query without any complaints and with correct results. Sorry to have wasted your time. Apologies, Tyler Hepworth