Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: DBD::CSV - SQL Syntax - "AND" clause is not working properly

by Anonymous Monk
on Aug 28, 2012 at 12:03 UTC ( #990225=note: print w/ replies, xml ) Need Help??


in reply to DBD::CSV - SQL Syntax - "AND" clause is not working properly

Note: Quoting "Strings" using double quotes are recognized as quoted identifiers (column or table names).

#!/usr/bin/perl -- use strict; use warnings; use Data::Dump; use DBI; use DBD::CSV; my $dbh = DBI->connect( "dbi:CSV:", undef, undef, { RaiseError => 1 }, ); my $sth = $dbh->prepare_cached(' select * from test.csv where OS=? and RELEASE=? LIMIT 8 '); $sth->execute( 'Fedora', 'Stentz' ); dd $sth->fetchall_arrayref; __END__ [["Fedora", "Stentz", 4]]


Comment on Re: DBD::CSV - SQL Syntax - "AND" clause is not working properly
Download Code
Re^2: DBD::CSV - SQL Syntax - "AND" clause is not working properly
by slayedbylucifer (Scribe) on Aug 28, 2012 at 17:48 UTC

      Again, vastly different from the code you posted here, which didn't even compile. The code you posted on SO looks like a combination of the replies you got here.

        Thats correct marto. This thread helped me to write the code in a better and correct manner which constituted my SO thread. But even after doing that, I did not get the intended result. Later it turned out that SQ::Statement was not properly installed. I want to thank you guys for your time and the guidance.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-09-18 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (124 votes), past polls