cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Drake <geo...@attglobal.net>
Subject Re: Wildcard in a SQL-query??
Date Mon, 24 Jul 2000 07:34:41 GMT
Hi Nick the usual syntax is:

select somefields from aTable
WHERE name like 'SMITH%'

Note the ' around SMITH%
Also like only works for text/char fields e.g. varchar.

Hope this helps

Geoff




Nicki Møller wrote:

> Hi All,
>
> Can anyone help me with making a query containing a
> wildcard. (something similar to this)
>
> WHERE day% like Starttime
>
> I've tried different wayes of dooing this but with out
> luck.
>
> Here's to examples on what I've tried
>
> --------------
> <xsp:logic>
> String day = request.getParameter ("day");
> day.trim();
> </xsp:logic>
>
>  <query connection="foo_connection">
>         SELECT Event_Id, Body, Starttime, Endtime FROM Events
> WHERE <xsp:expr>day</xsp:expr>% like Starttime
> ORDER BY Event_Id
>  </query>
> --------------
>
> --------------
> <xsp:logic>
> String day = request.getParameter ("day");
> day = day + "%"
> day.trim();
> </xsp:logic>
>
>  <query connection="foo_connection">
>         SELECT Event_Id, Body, Starttime, Endtime FROM Events
> WHERE <xsp:expr>day</xsp:expr> like Starttime
> ORDER BY Event_Id
>  </query>
> --------------
>
> All help is appreciated
>
> -Nicki
>
> ______________________________________________________
> Do You Yahoo!?
> Få en gratis @yahoo.dk-adresse på http://mail.yahoo.dk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message