You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Mark S. Kent" <ma...@vistyx.com> on 2001/09/28 23:13:47 UTC

C1: ESQL handling single apostrophes

I have an XSP created string that I am passing to ESQL to create a dynamic
SQL string.  It worked fine until I added: "and some_date < 'today'" to the
WHERE clause (InterBase 6.0 format for the 'today' value).

I've tried this:
<page>
    <xsp:logic>
        String dynSQL = "select foo from bar where some_date = 'today' ";
    </xsp:logic>

    <esql:connection>
        <esql:pool>default</esql:pool>
        <esql:execute-query>
            <esql:query><xsp:expr>dynSQL</xsp:expr></esql:query>
            <esql:results>
                <esql:row-results>
                    <foodata><esql:get-string column="foo"/></foodata>
                </esql:row-results>
            </esql:results>
            </esql:query>
        </esql:execute-query>
    </esql:connection>
</page>

Other previous postings that others have used had something like this:
        String dynSQL = "select foo from bar where some_date = '" +
todayString + "' ";

but that's not working for me either...

Mark


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: C1: ESQL handling single apostrophes

Posted by Vadim Gritsenko <va...@verizon.net>.
Just guessing:

Try 
"and some_date &lt; 'today'"

:)

Vadim

> -----Original Message-----
> From: Mark S. Kent [mailto:mark.kent@vistyx.com]
> Sent: Friday, September 28, 2001 5:14 PM
> To: cocoon-users@xml.apache.org
> Subject: C1: ESQL handling single apostrophes
> 
> 
> I have an XSP created string that I am passing to ESQL to create a dynamic
> SQL string.  It worked fine until I added: "and some_date < 'today'" to the
> WHERE clause (InterBase 6.0 format for the 'today' value).
> 
> I've tried this:
> <page>
>     <xsp:logic>
>         String dynSQL = "select foo from bar where some_date = 'today' ";
>     </xsp:logic>
> 
>     <esql:connection>
>         <esql:pool>default</esql:pool>
>         <esql:execute-query>
>             <esql:query><xsp:expr>dynSQL</xsp:expr></esql:query>
>             <esql:results>
>                 <esql:row-results>
>                     <foodata><esql:get-string column="foo"/></foodata>
>                 </esql:row-results>
>             </esql:results>
>             </esql:query>
>         </esql:execute-query>
>     </esql:connection>
> </page>
> 
> Other previous postings that others have used had something like this:
>         String dynSQL = "select foo from bar where some_date = '" +
> todayString + "' ";
> 
> but that's not working for me either...
> 
> Mark
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>