[Zope] Searching method due to situation
Angietel
angietel@hotmail.com
Mon, 15 Jan 2001 13:11:14 +0800
This is a multi-part message in MIME format.
------=_NextPart_000_0119_01C07EF4.A3512CE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
=20
The following is my DTML code, purposely to valid the entry field and =
return the right sql Searching method according to the situation:-
<dtml-if "_['<dtml-var custname>']!=3D""" AND "_['<dtml-var =
custid>']=3D=3D""">=20
<dtml-in sqlSearchcust3>
#// if the custid is blank and custname is not blank then will use =
sqlSearch3
=20
<dtml-elif "_['<dtml-var custid>']!=3D""" AND "_['<dtml-var =
custname>']=3D=3D""">
<dtml-in sqlSearchcust2>
#// if the custid is not blank and custname is blank then will use =
sqlSearch2
<dtml-elif "_['<dtml-var custid>']=3D=3D""" AND "_['<dtml-var =
custname>']=3D=3D"""> =20
=20
<dtml-in sqlSearchcust>
#// if the custname is not blank and custid is not blank then will use =
sqlSearch
<dtml-else>
<dtml-var expr=3D"REQUEST['/Customer/View/searchallcust']">=20
#// if the custname is blank and custid is blank then will go to view =
a list of customer record.
</dtml-if>
=20
The following is the ZOPE error:-
Unexpected tag, for tag <dtml-elif "_['<dtml-var custid>']=3D=3D""" AND =
"_['<dtml-var custname>']!=3D""">, on line 9 of a
=20
=20
For my sql method syntax are as follow:-
1.sqlSearchcust3
=20
select *
from customer
<dtml-sqlgroup where>
<dtml-sqltest custid op=3Dne type=3Dstring>
<dtml-and>
<dtml-sqltest custname op=3Dlike'%%' type=3Dstring>
</dtml-sqlgroup>
2. sqlSearchcust2
select *
from customer
<dtml-sqlgroup where>
<dtml-sqltest custid op=3Deq type=3Dstring>
<dtml-and>
<dtml-sqltest custname op=3Dne type=3Dstring>
</dtml-sqlgroup>
3. sqlSearchcust
select *
from customer
<dtml-sqlgroup where>
<dtml-sqltest custid op=3Deq type=3Dstring>
<dtml-and>
<dtml-sqltest custname op=3Dlike'%%' type=3Dstring>
</dtml-sqlgroup>
=20
This is urgent! Please give me some solution, Thanks!
------=_NextPart_000_0119_01C07EF4.A3512CE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The following is my DTML code, =
purposely to valid=20
the entry field and return the right sql Searching method according to =
the=20
situation:-</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><dtml-if "_['<dtml-var =
custname>']!=3D"""=20
AND "_['<dtml-var custid>']=3D=3D"""> </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =
<dtml-in=20
sqlSearchcust3><BR> #// if the custid is blank and=20
cust</FONT><FONT face=3DArial size=3D2>name is not blank then will =
use=20
sqlSearch3</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> <BR><dtml-elif =
"_['<dtml-var=20
custid>']!=3D""" AND "_['<dtml-var =
custname>']=3D=3D"""></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =
<dtml-in=20
sqlSearchcust2></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> #// if the custid is not =
blank and=20
custname is blank then will use sqlSearch2</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><dtml-elif "_['<dtml-var =
custid>']=3D=3D"""=20
AND "_['<dtml-var=20
custname>']=3D=3D"""> &nbs=
p; =20
<BR> =20
<BR> <dtml-in=20
sqlSearchcust><BR></FONT><FONT face=3DArial size=3D2> #// =
if the=20
custname is not blank and custid is not blank then will use=20
sqlSearch<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><dtml-else></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =
<dtml-var=20
expr=3D"REQUEST['/Customer/View/searchallcust']"> </FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial =
size=3D2> #// if the=20
custname is blank and custid is blank then will go to =
view a list=20
of customer record.<BR></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></dtml-if><BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The following is the ZOPE =
error:-</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Unexpected tag, for tag <dtml-elif=20
"_['<dtml-var custid>']=3D=3D""" AND "_['<dtml-var =
custname>']!=3D""">,=20
on line 9 of a</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>For my sql method syntax are as=20
follow:-</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>1.sqlSearchcust3</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> select *<BR>from=20
customer<BR><dtml-sqlgroup where><BR> <dtml-sqltest =
custid=20
op=3Dne type=3Dstring><BR><dtml-and><BR> <dtml-sqltest =
custname=20
op=3Dlike'%%' type=3Dstring><BR></dtml-sqlgroup></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>2. sqlSearchcust2</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>select *<BR>from =
customer<BR><dtml-sqlgroup=20
where><BR> <dtml-sqltest custid op=3Deq=20
type=3Dstring><BR><dtml-and><BR> <dtml-sqltest custname =
op=3Dne=20
type=3Dstring><BR></dtml-sqlgroup><BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>3. sqlSearchcust</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>select *<BR>from =
customer<BR><dtml-sqlgroup=20
where><BR> <dtml-sqltest custid op=3Deq=20
type=3Dstring><BR><dtml-and><BR> <dtml-sqltest custname =
op=3Dlike'%%' =
type=3Dstring><BR></dtml-sqlgroup><BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>This is urgent! Please give me some =
solution,=20
Thanks!</DIV></FONT></FONT></DIV></BODY></HTML>
------=_NextPart_000_0119_01C07EF4.A3512CE0--