cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nishit Trivedi" <nis...@planet.net>
Subject Re: SQL and XSP!!!!
Date Wed, 31 May 2000 13:27:31 GMT
Instead what you can do is:
--------------------------------------------------------------------
<xsp:logic>
 String[] tst=request.getParametersValues("type");
 String query = "";
 query = "select * from pet where species= '" + tst[0] + "';
 </xsp:logic>

<query connection="first">
   <xsp:expr>query</xsp:expr>
 </query>
--------------------------------------------------------------------

Note exact location of single and double quotes when you insert xsp
variable..
tst[0] is surrounded by + sign which is surrounded by pair of double quotes
which is surrounded by pair of single quotes..

Nishit
Internet Programmer
Planet Access Networks
973-691-4704 Ext:157
----- Original Message -----
From: "mohamed ramzy" <m_ramzy@yahoo.com>
To: "Cocoon list" <cocoon-users@xml.apache.org>
Sent: Wednesday, May 31, 2000 9:11 AM
Subject: SQL and XSP!!!!


> hi
> i want to make a dynamic query by useing XSP with SQL,
> i did a simple Query but it didn't work ..which is
>
>
> <xsp:logic>
> String[] tst=request.getParametersValues("type");
> </xsp:logic>
> <query connection="first">
> select * from pet
> where species= "<xsp:expr>tst[0]</xsp:expr>"
> </query>
>
> where "type" holds the name of a species.....
> it didn't work///
>
> does anyone has an idea!!!!!
>
> Thanx in Advance
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
>
> ---------------------------------------------------------------------
> 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