[Zope] sqlgroup sqltest combo - strange optional string behavior?

Sean McGerty DrBob@speednet.com.au
Mon, 07 Jun 1999 15:48:32 +1000


--=====================_108675508==_.ALT
Content-Type: text/plain; charset="us-ascii"

My apologies gentlemen... I'd search the egroups link off the zope site but
it's timing out at the egroups site... so anyhow:

I'm attempting to write a search interface for a table called company where the
2 fields recNum and recName are optional - along the lines of the sample in the
ZSQL methods howto:
:select * from Company 
:<!--#sqlgroup required where--> 
:   <!--#sqlgroup--> 
:      <!--#sqltest recNum optional type=int--> 
:         <!--#and--> 
:      <!--#sqltest recName column=name optional type=string--> 
:   <!--#/sqlgroup--> 
:<!--#/sqlgroup--> 

Now if I enter recNum=1 and recName='' I get:
:select * from Company 
:where
:(recNum=1
: and name=''
:)

When I'd expect the optional tag in the recName sqltest statement should have
removed the (and name='') line in the generated SQL. Any ideas?

If it helps here's the version information I'm running:
You are running Zope version: Zope 1.10.2 (binary release, python 1.5.1,
win32-x86), on Python 1.5.1 (#0, Nov 18 1998, 12:17:58) [MSC 32 bit (Intel)] on
win32. 

Thanks,

Sean.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= _ /\= 
 ___   Sean McGerty aka DrBob    C++::Java::Delphi::Web Developer /    \ 
<*,-> mailto:DrBob@speednet.com.au m+61-412336990 Sydney Australia\_- _* 
[`-'] new address "Democracy: Four wolves and a lamb voting on lunch" v. 
-"-"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


--=====================_108675508==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
<font size=3>My apologies gentlemen... I'd search the egroups link off
the zope site but it's timing out at the egroups site... so anyhow:<br>
<br>
I'm attempting to write a search interface for a table called company
where the 2 fields recNum and recName are optional - along the lines of
the sample in the ZSQL methods howto:<br>
:select * from Company <br>
:&lt;!--#sqlgroup required where--&gt; <br>
:&nbsp;&nbsp; &lt;!--#sqlgroup--&gt; <br>
:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--#sqltest recNum optional
type=int--&gt; <br>
:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--#and--&gt; 
<br>
:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--#sqltest recName column=name
optional type=string--&gt; <br>
:&nbsp;&nbsp; &lt;!--#/sqlgroup--&gt; <br>
:&lt;!--#/sqlgroup--&gt; <br>
<br>
Now if I enter recNum=1 and recName='' I get:<br>
:select * from Company <br>
:where<br>
:(recNum=1<br>
: and name=''<br>
:)<br>
<br>
When I'd expect the optional tag in the recName sqltest statement should
have removed the (and name='') line in the generated SQL. Any 
ideas?<br>
<br>
If it helps here's the version information I'm running:<br>
You are running <i>Zope</i> version: Zope 1.10.2 (binary release, python
1.5.1, win32-x86), on Python 1.5.1 (#0, Nov 18 1998, 12:17:58) [MSC 32
bit (Intel)] on win32. <br>
<br>
Thanks,<br>
<br>
Sean.<br>
</font><br>

<font face="Fixedsys" size=3 color="#C0C0C0"><div align="center">
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</font><font face="Fixedsys" size=3 color="#800000">
</font><font face="Fixedsys" size=3 color="#008000">_
/\</font><font face="Fixedsys" size=3 color="#C0C0C0">= <br>
</font><font face="Fixedsys" size=3 color="#0000FF">&nbsp;</font><font face="Fixedsys" size=3 color="#800000">___</font><font face="Fixedsys" size=3 color="#0000FF">&nbsp;&nbsp;
Sean McGerty</font><font face="Fixedsys" size=3 color="#C0C0C0"> aka
</font><font face="Fixedsys" size=3 color="#0000FF">DrBob</font><font face="Fixedsys" size=3 color="#C0C0C0">&nbsp;&nbsp;&nbsp;
</font><font face="Fixedsys" size=3 color="#800000">C++::Java::Delphi::Web
Developer
</font><font face="Fixedsys" size=3 color="#008000">/&nbsp;&nbsp;&nbsp;
\</font><font face="Fixedsys" size=3 color="#C0C0C0"> <br>
</font><font face="Fixedsys" size=3 color="#800000">&lt;*,-&gt;</font><font face="Fixedsys" size=3 color="#C0C0C0">
</font><a href="mailto:DrBob@speednet.com.au" eudora="autourl"><font face="Fixedsys" size=3 color="#008000">mailto:DrBob@speednet.com.au</a></font><font face="Fixedsys" size=3 color="#C0C0C0">
m+61-412336990 Sydney
Australia</font><font face="Fixedsys" size=3 color="#008000">\_-
_</font><font face="Fixedsys" size=3 color="#FF0000">*</font><font face="Fixedsys" size=3 color="#C0C0C0">
<br>
</font><font face="Fixedsys" size=3 color="#800000">[`-']</font><font face="Fixedsys" size=3 color="#C0C0C0">
</font><font face="Fixedsys" size=3 color="#FF00FF">new
address</font><font face="Fixedsys" size=3 color="#C0C0C0">
&quot;Democracy: Four wolves and a lamb voting on
lunch&quot;</font><font face="Fixedsys" size=3 color="#808080">
</font><font face="Fixedsys" size=3 color="#008000">v</font><font face="Fixedsys" size=3 color="#C0C0C0">.
<br>
-</font><font face="Fixedsys" size=3 color="#800000">&quot;</font><font face="Fixedsys" size=3 color="#C0C0C0">-</font><font face="Fixedsys" size=3 color="#800000">&quot;</font><font face="Fixedsys" size=3 color="#C0C0C0">-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<br>
<br>
</font></html>

--=====================_108675508==_.ALT--