Howdy bulrush! Could you be so kind and post complete, working code that demonstrates the problem? Yours not only doesn't compile (writeerr() is not included), it also doesn't do anything. Furthermore, it'd be nice if you could use proper <code> tags for your code, since that'll allow us to download code rather than having to copy and paste it.

Once we've got some code that demonstrates the issue you're experiencing, we'll be in a much better position to help you.

EDIT: to expand on the above, the following test script IS working for me:

#!/usr/bin/perl use strict; use warnings; use feature qw/say/; use DBD::SQLite; use Data::Dumper; our $dbfile = "test.db"; my $dbh = DBI->connect("dbi:SQLite:$dbfile", undef, undef, { AutoCommit => 1, RaiseError => 1 }); # create table, if necessary $dbh->do("CREATE TABLE IF NOT EXISTS data (skey TEXT PRIMARY KEY, sval +ue TEXT);"); # insert data $dbh->do("INSERT OR REPLACE INTO data (skey, svalue) VALUES ('Stuff', +'Ge 1:1-more \&stuff\& here ');"); # fetch data my $sth = $dbh->prepare("SELECT skey, svalue FROM data WHERE skey = 'S +tuff';"); $sth->execute(); my $results = $sth->fetchall_hashref("skey"); say Dumper $results;

This correctly prints:

$VAR1 = { 'Stuff' => { 'svalue' => 'Ge 1:1-more &stuff& here ', 'skey' => 'Stuff' } };

In reply to Re: DBD::SQLite select fails by AppleFritter
in thread DBD::SQLite select fails by bulrush

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.