This is way off-topic for this, but I can see two things wrong. First off, you aren't actually returning any records.
You may want to use this...
my $csr = $dbh->sqlSelectMany("*", "company_contact_info", "region='S
+an Diego'");
while(my $row = $csr->fetchrow_hashref())
{
#row is now a single returned row that matched your query;
}
As well, your SQL regular expression is also wrong. When doing regular expressions in SQL, you want to use LIKE
(for
mySQL and
SQL Server I believe at least)
SELECT * FROM company_contact_info WHERE REGION LIKE "%San Diego%"
Without LIKE, it won't interpret the string as a regular expression, and thus will be searching for "\%San Diego\%"
This begs another question. Why are you storing items in your database as strings. If they are raw address fields, then there's no good way to do it (unless you parse the results as you receive them and store a string independant region key, but that depends on the application in which you are calling this database.) Indexes and numerical keys can be quite helpful and much faster.
Hope this helps.
--jay
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.