cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henning von Bargen <H.vonBar...@Triestram-Partner.de>
Subject AW: Wildcard in a SQL-query??
Date Mon, 24 Jul 2000 08:52:04 GMT
But if you test with non-valid SQL syntax as in the examples you gave 
then you cannot expect variables to work.
Henning

> -----Ursprüngliche Nachricht-----
> Von:	Nicki Møller [SMTP:nicki_moller@yahoo.dk]
> Gesendet am:	Montag, 24. Juli 2000 10:13
> An:	cocoon-users@xml.apache.org; geoffd@attglobal.net
> Betreff:	Re: Wildcard in a SQL-query??
> 
> Hi Geoff,
> 
> Thanxs for the suggestion, but the syntax of the
> SQL-query I know. 
> It's more the syntax on how I refere to a variable I'm
> looking for.
> 
> -Nicki
> 
> 
> 
> --- Geoff Drake <geoffd@attglobal.net> skrev: > 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
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail:
> > cocoon-users-help@xml.apache.org
> > 
> 
> 
> ______________________________________________________
> 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