logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: quoting quotes for sql statements: msg#00062

Subject: Re: quoting quotes for sql statements
>>>>> "Jason" == Jason Lewis <jason-igAks8JoejJQ+HMy2YlzRA@xxxxxxxxxxxxxxxx> 
>>>>> writes:

Jason> Hi,
Jason> I am trying to execute a query and having problems with the quotes.

Jason> this is what I want to do:

Jason> [%    FOREACH item = DBI.query('SELECT YCatalogue.CatalogueTitle FROM
Jason> YCatalogue' where CatalogueTitle = "January 2004"') %]

Jason> but TT doesn't seem to like my double quotes in the single
Jason> quotes. Should I escape them somehow? or am I doing something wrong?

Yes, use a placeholder.

[% query = DBI.prepare("SELECT YCatalogue.CatalogueTitle FROM YCatalogue where 
CatalogueTitle = ?");
  FOREACH item = query.execute("January 2004"); %] ... [% END %]

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn-DiZw3cqpylQkmLvzuZlaBw@xxxxxxxxxxxxxxxx> 
<URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>