Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: DBD::SQLite failing to return data?

by aquarium (Curate)
on Nov 11, 2010 at 00:17 UTC ( [id://870743]=note: print w/replies, xml ) Need Help??


in reply to Re^2: DBD::SQLite failing to return data?
in thread DBD::SQLite failing to return data?

also are you wanting the data fetch loop to always exit using die?..as there's an endless loop.
the hardest line to type correctly is: stty erase ^H

Replies are listed 'Best First'.
Re^4: DBD::SQLite failing to return data?
by BrowserUk (Patriarch) on Nov 11, 2010 at 01:11 UTC
    also are you wanting the data fetch loop to always exit using die?.

    No. That was just a debugging strategy. In the normal way of things the loop is:

    while( my $data = $sth->fetchrow_arrayref ) { print "$data : @{ $data }"; }

    But doesn't give easy opportunity to output any errstr.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      would this work (untested)?
      while( my $data = $sth->fetchrow_arrayref || die $sth->errstr; ) { print "$data : @{ $data }"; }
      the hardest line to type correctly is: stty erase ^H

        You'd have to drop the semi-colon :)

        But even then, it would die when it reached the end of the data, rather than exiting the loop cleanly and moving on to the next step of the processing.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-19 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found