I am using DBI and the CSV driver DBD::CSV for manipulating the the CSV files. my SELECT query is not interpreting the way I want it ot.
e.g., consider following table called test.csv:
So, I want to list the version for Fedora Stentz which is "4".
I have written below query:
my $query = "SELECT VERSION from test.csv WHERE OS="Fedora" AND RELEAS
my $sth = $dbh->prepare ($query);
However, I get below error:
DBD::CSV::st execute failed: No such column '"Fedora" AND RELEASE="Ste
+ntz"' at /usr/local/lib/perl/5.10.1/DBI/DBD/SqlEngine.pm line 796
So, This means the use of "AND" clause is causing the problem. I have worked a little bit on Oracle DB and know that the above Query would work fine on Oracle DB.
however, I am not able to put "AND" clause to work in above query.
I hve referred the documnetion @ SQL::Statement::Syntax (which is used by DBD::CSV), however it doensn't talk much about the "AND" clause usage.
Could you help in correcting the query please.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] |