Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^3: DBD::SQLite select fails

by poj (Vicar)
on Aug 12, 2014 at 11:54 UTC ( #1097110=note: print w/ replies, xml ) Need Help??

in reply to Re^2: DBD::SQLite select fails
in thread DBD::SQLite select fails

Method fetchrows_array does not exist. What where you expecting @rows to contain ?
Update: Maybe you meant fetchrow_array like this

#!perl use strict; use DBD::SQLite; use Data::Dump 'pp'; my $dbfile = 'test.sqlite'; my $dbh = DBI->connect('dbi:SQLite:'.$dbfile , undef , undef , {RaiseError =>1, AutoCommit =>1}) or die $DBI::errstr; $dbh->do('CREATE TABLE IF NOT EXISTS data ( skey TEXT PRIMARY KEY, svalue TEXT )'); $dbh->do("INSERT INTO data (skey, svalue) VALUES ('Stuff','Ge 1:1-more &stuff&here ')"); my $sql = "SELECT svalue FROM data WHERE skey='Stuff'"; my $sth = $dbh->prepare($sql); $sth->execute(); my @row = $sth->fetchrow_array; pp @row;

Comment on Re^3: DBD::SQLite select fails
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1097110]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2015-08-30 12:50 GMT
Find Nodes?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...

    Results (349 votes), past polls