[Zope-dev] ZSQL and Normalized databases (or why ZSQL sucks)

Adrian Hungate ahungate@acucorp.com
Fri, 20 Apr 2001 03:06:39 -0700


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C0C981.9B7C1790
Content-Type: text/plain;
	charset="iso-8859-1"

May be I am misunderstanding your problem here, but are you suggesting that

    SELECT tab1.col1 col1, tab2.col1 col2
    FROM ... etc ...

Does not expose 'col1' and 'col2' in the namespace for you? This is not my
experience. Ok, I only have about 50 ZSQL methods on my intranet but they
are all complex queries with column naming clashes. If it failed to work as
you are suggesting, I would not have continued using Zope - Database
connectivity was one of my criteria.

The normality (or abnormality) of your databases should make no difference,
(Except to how complex your individual SQL statements become). What database
are you running against? Maybe you have hit a database connector bug?

I have the following query that our sales-reps use to check how much product
we sold in the last 'n' days/weeks/months etc...

-----
PARAMS: dDate, sOffsetSize, nOffset

SELECT DISTINCT
       Order_.Shipped_Date Date,
       Region.Region_Name Region,
       Employee.Number_ ID,
       Territory.Territory_Name Territory,
       Currency_Exchange_Rate.From_Currency_Code Currency,
       SUM(Order_.Sub_Total - Order_.Order_Discount_Amount) Local,
       Currency_Exchange_Rate.Current_Exchange_Rate * SUM(Order_.Sub_Total -
Order_.Order_Discount_Amount) Dollar
FROM Region
INNER JOIN Territory ON Region.Region_Id = Territory.Region_Id
INNER JOIN Company ON Territory.Territory_ID = Company.Territory_ID
INNER JOIN Order_ ON Company.Company_ID = Order_.Bill_To_Company_ID
INNER JOIN Currency_Exchange_Rate ON Order_.Currency_ID =
Currency_Exchange_Rate.From_Currency_ID
INNER JOIN Employee ON Order_.Account_Manager = Employee.Employee_Id
<dtml-sqlgroup where>
(Currency_Exchange_Rate.To_Currency_Code = 'USD')
<dtml-and>
(Order_.Status IN ('Invoiced', 'Billed', 'Shipped'))
<dtml-and>
(Order_.Shipped_Date IS NOT NULL)
<dtml-and>
(Order_.Sub_Total <> 0)
<dtml-and>
(datediff(day, Order_.Shipped_Date, '<dtml-var dDate>') >= 0)
<dtml-and>
(datediff(<dtml-var sOffsetSize>, Order_.Shipped_Date, '<dtml-var dDate>') <
<dtml-var nOffset>)
</dtml-sqlgroup>
GROUP BY Order_.Shipped_Date, Region.Region_Name, Employee.Number_,
Territory.Territory_Name, Currency_Exchange_Rate.From_Currency_Code,
Currency_Exchange_Rate.Current_Exchange_Rate
ORDER BY Region.Region_Name, Employee.Number_, Territory.Territory_Name,
Currency_Exchange_Rate.From_Currency_Code

-----

This exposes 'Date', 'Region', 'ID', 'Territory', 'Currency', 'Local' and
'Dollar' to the calling script. I use this from a Python product, python
scripts and from DTML all the time (10's or 100's of times per day at
least).

As far as the 'foo=0' example, if you set foo to 0, and do nothing in
between to change it, of course a test for not equal to 0 will fail, what
would you expect?

Adrian...

-----Original Message-----
From: The Doctor What [mailto:docwhat@gerf.org]
Sent: Thursday, 19 April 2001 23:22
To: Paul Erickson
Cc: zope-dev@zope.org
Subject: Re: [Zope-dev] ZSQL and Normalized databases (or why ZSQL
sucks)


* Paul Erickson (erickson@kaivo.com) [010419 17:02]:
> The Doctor What wrote:
> > > * Loosing the variable between the form and dtml-if
> 
> I don't understand this.  I'm assuming that you are losing values that
> are not in your argument list.  All you have to do is add the arguments.

That isn't what I mean.  Try this (typed in, so it may need to be
adjusted):
<param>foo=0</param>
<dtml-if expr="foo != 0">Life is good</dtml-if>

You'll NEVER get Life is good to print out.  EVER.  This is because
ZSQL is setting foo to 0.  But dtml-var and dtml-sqlvar both work.

> > > * Inability to handle table.field names for variables
> > > * And enough flexibility to work around the above problems
> > >
> > > This makes ZSQL extreamely nasty, and impossible to use with a
> > > normalized database.
> 
> Database normalization isn't really an issue.  It sounds like you're
> really just having problems with the syntax of joins.

Nope, can do joins.  Been doing joins (mainly inner).  Not the
problem.  The problem is that if I have tables like:
Table1
------
id
name
desc

Table2
------
id
Table1ID   <-- Foreign Key thrown in for fun.
name
desc

And I join them, then I MUST rename all the selects using AS:
select
  Table1.id as id1
  Table1.name as name1
...etc....

Because I can't have zsql put the variables in the caller's
namespace as "Table1.id".  It puts them in as "id" (without the AS).

Fortunately, I found the column for sqltest (which is the other end
of ZSQL):
<dtml-sqltest id1 column="Table1.id" ....

> > >
> > > What's the point?  ZSQL sucks, how do I talk to the DB directly?
> 
> Grab the Python database adapter and write some python classes or
> external methods to do what you need.

Can I use them from a python script?  If not, what's the point?  I
mean: External methods are nice to have when you have *no other
choice*, but they aren't something I'd want to debug and deal with
for object.

> > This makes things work MUCH better.  So there are work arounds.
> 
> This isn't a work-around, it is the way that it is intended to be used.

I didn't see a single example of it.  The Zope Book didn't mention
this at all (except as a single line reference).  I would *never*
have gone looking for the word column.  Why? It's a field!

> Again, I think that it's a matter of understanding how ZSQL works,
> rather than a limitation of ZSQL.  If you have column name conflicts,
> you can always use something like:
> 
> SELECT a.field as a_field, b.field as b_field FROM ...
> 
> Then refer to them in dtml like &dtml-a_field; or <dtml-var
> name="a_field">

Right, but you still have to do extra work to get them back into a
ZSQL object.  column lets you do that.  It's got no examples to help
out with.  It's documented once.  I didn't see it.  Life is better
now.

> > I still would love some examples.  Do people end up with 4 ZSQL
> > objects per thing they manipulate in their database?:
> > UPDATE, SELECT, INSERT and DELETE?  Or do they mix them somehow?
> 
> I typically wind up with a ZSQL method for each of the CRUD operations. 
> Sometimes I have separate selects methods for more complex joins, if the
> DTML code gets too ugly when I try to combine them into a single method.
>
> 
> Example of a fairly typical join statement (for MySQL database):
> 
> Arguments-
> begin_date:date end_date:date="2037-01-01"
> 
> SELECT search_string, search_result,  search_date, result_category,
> legal_category.name
> FROM search_log LEFT JOIN legal_category ON
> search_log.result_category=legal_category.code
> 
> <dtml-sqlgroup required where>
>   <dtml-sqltest name="begin_date" op="gt" type="nb"
>       column="search_date">
> <dtml-and>
>   <dtml-sqltest name="end_date" type="nb" op="lt"
>       column="search_date" optional>
> </dtml-sqlgroup>

Hey!  An example!

> Good Luck

Thanks.  So I'm still having trouble.  I can't get any of the list
examples to work.

I build a select multiple list, and then try to dtml-in on it.  It
doesn't seem to work.  REQUEST shows in it th other and form
namespaces, as a list, but I can't actually dtml-var it or anything.

Example:
q<dtml-var dalist>p
<br>
<dtml-in VirtualRootPhysicalPath>
d<dtml-var sequence-item>b
</dtml-in>
<hr>
<dtml-var REQUEST>

If you call this with this URL (substitute as needed):
http://docwhat.gerf.org:9673/links/test?dalist%0D%0A%3Alist=1&dalist%0D%0A%3
Alist=3&dalist%0D%0A%3Alist=8

Which is the URL pattern formed by a <SELECT name="dalist:list"
multiple>....

Then you get errors on dalist.  The examples at
http://www.zope.org/Members/AlexR/SelectionLists

Don't work as exactl above.

Help?

Ciao!

-- 
Outside of a dog, a book is a man's best friend.  Inside a dog it's too dark
to read.
	-- Groucho Marx

The Doctor What: Need I say more?                http://docwhat.gerf.org/
docwhat@gerf.org                                                   KF6VNC

------_=_NextPart_001_01C0C981.9B7C1790
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>RE: [Zope-dev] ZSQL and Normalized databases (or why ZSQL =
sucks)</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>May be I am misunderstanding your problem here, but =
are you suggesting that</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; SELECT tab1.col1 col1, tab2.col1 =
col2</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; FROM ... etc ...</FONT>
</P>

<P><FONT SIZE=3D2>Does not expose 'col1' and 'col2' in the namespace =
for you? This is not my experience. Ok, I only have about 50 ZSQL =
methods on my intranet but they are all complex queries with column =
naming clashes. If it failed to work as you are suggesting, I would not =
have continued using Zope - Database connectivity was one of my =
criteria.</FONT></P>

<P><FONT SIZE=3D2>The normality (or abnormality) of your databases =
should make no difference, (Except to how complex your individual SQL =
statements become). What database are you running against? Maybe you =
have hit a database connector bug?</FONT></P>

<P><FONT SIZE=3D2>I have the following query that our sales-reps use to =
check how much product we sold in the last 'n' days/weeks/months =
etc...</FONT></P>

<P><FONT SIZE=3D2>-----</FONT>
<BR><FONT SIZE=3D2>PARAMS: dDate, sOffsetSize, nOffset</FONT>
</P>

<P><FONT SIZE=3D2>SELECT DISTINCT</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Order_.Shipped_Date Date,</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Region.Region_Name Region,</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Employee.Number_ ID,</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Territory.Territory_Name Territory,</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Currency_Exchange_Rate.From_Currency_Code Currency,</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
SUM(Order_.Sub_Total - Order_.Order_Discount_Amount) Local,</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Currency_Exchange_Rate.Current_Exchange_Rate * SUM(Order_.Sub_Total - =
Order_.Order_Discount_Amount) Dollar</FONT>
<BR><FONT SIZE=3D2>FROM Region</FONT>
<BR><FONT SIZE=3D2>INNER JOIN Territory ON Region.Region_Id =3D =
Territory.Region_Id</FONT>
<BR><FONT SIZE=3D2>INNER JOIN Company ON Territory.Territory_ID =3D =
Company.Territory_ID</FONT>
<BR><FONT SIZE=3D2>INNER JOIN Order_ ON Company.Company_ID =3D =
Order_.Bill_To_Company_ID</FONT>
<BR><FONT SIZE=3D2>INNER JOIN Currency_Exchange_Rate ON =
Order_.Currency_ID =3D Currency_Exchange_Rate.From_Currency_ID</FONT>
<BR><FONT SIZE=3D2>INNER JOIN Employee ON Order_.Account_Manager =3D =
Employee.Employee_Id</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-sqlgroup where&gt;</FONT>
<BR><FONT SIZE=3D2>(Currency_Exchange_Rate.To_Currency_Code =3D =
'USD')</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-and&gt;</FONT>
<BR><FONT SIZE=3D2>(Order_.Status IN ('Invoiced', 'Billed', =
'Shipped'))</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-and&gt;</FONT>
<BR><FONT SIZE=3D2>(Order_.Shipped_Date IS NOT NULL)</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-and&gt;</FONT>
<BR><FONT SIZE=3D2>(Order_.Sub_Total &lt;&gt; 0)</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-and&gt;</FONT>
<BR><FONT SIZE=3D2>(datediff(day, Order_.Shipped_Date, '&lt;dtml-var =
dDate&gt;') &gt;=3D 0)</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-and&gt;</FONT>
<BR><FONT SIZE=3D2>(datediff(&lt;dtml-var sOffsetSize&gt;, =
Order_.Shipped_Date, '&lt;dtml-var dDate&gt;') &lt; &lt;dtml-var =
nOffset&gt;)</FONT>
<BR><FONT SIZE=3D2>&lt;/dtml-sqlgroup&gt;</FONT>
<BR><FONT SIZE=3D2>GROUP BY Order_.Shipped_Date, Region.Region_Name, =
Employee.Number_, Territory.Territory_Name, =
Currency_Exchange_Rate.From_Currency_Code, =
Currency_Exchange_Rate.Current_Exchange_Rate</FONT></P>

<P><FONT SIZE=3D2>ORDER BY Region.Region_Name, Employee.Number_, =
Territory.Territory_Name, Currency_Exchange_Rate.From_Currency_Code</FON=
T>
</P>

<P><FONT SIZE=3D2>-----</FONT>
</P>

<P><FONT SIZE=3D2>This exposes 'Date', 'Region', 'ID', 'Territory', =
'Currency', 'Local' and 'Dollar' to the calling script. I use this from =
a Python product, python scripts and from DTML all the time (10's or =
100's of times per day at least).</FONT></P>

<P><FONT SIZE=3D2>As far as the 'foo=3D0' example, if you set foo to 0, =
and do nothing in between to change it, of course a test for not equal =
to 0 will fail, what would you expect?</FONT></P>

<P><FONT SIZE=3D2>Adrian...</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: The Doctor What [<A =
HREF=3D"mailto:docwhat@gerf.org">mailto:docwhat@gerf.org</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Thursday, 19 April 2001 23:22</FONT>
<BR><FONT SIZE=3D2>To: Paul Erickson</FONT>
<BR><FONT SIZE=3D2>Cc: zope-dev@zope.org</FONT>
<BR><FONT SIZE=3D2>Subject: Re: [Zope-dev] ZSQL and Normalized =
databases (or why ZSQL</FONT>
<BR><FONT SIZE=3D2>sucks)</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>* Paul Erickson (erickson@kaivo.com) [010419 =
17:02]:</FONT>
<BR><FONT SIZE=3D2>&gt; The Doctor What wrote:</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; &gt; * Loosing the variable between the =
form and dtml-if</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; I don't understand this.&nbsp; I'm assuming =
that you are losing values that</FONT>
<BR><FONT SIZE=3D2>&gt; are not in your argument list.&nbsp; All you =
have to do is add the arguments.</FONT>
</P>

<P><FONT SIZE=3D2>That isn't what I mean.&nbsp; Try this (typed in, so =
it may need to be</FONT>
<BR><FONT SIZE=3D2>adjusted):</FONT>
<BR><FONT SIZE=3D2>&lt;param&gt;foo=3D0&lt;/param&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-if expr=3D&quot;foo !=3D 0&quot;&gt;Life is =
good&lt;/dtml-if&gt;</FONT>
</P>

<P><FONT SIZE=3D2>You'll NEVER get Life is good to print out.&nbsp; =
EVER.&nbsp; This is because</FONT>
<BR><FONT SIZE=3D2>ZSQL is setting foo to 0.&nbsp; But dtml-var and =
dtml-sqlvar both work.</FONT>
</P>

<P><FONT SIZE=3D2>&gt; &gt; &gt; * Inability to handle table.field =
names for variables</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; &gt; * And enough flexibility to work =
around the above problems</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; &gt;</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; &gt; This makes ZSQL extreamely nasty, and =
impossible to use with a</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; &gt; normalized database.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Database normalization isn't really an =
issue.&nbsp; It sounds like you're</FONT>
<BR><FONT SIZE=3D2>&gt; really just having problems with the syntax of =
joins.</FONT>
</P>

<P><FONT SIZE=3D2>Nope, can do joins.&nbsp; Been doing joins (mainly =
inner).&nbsp; Not the</FONT>
<BR><FONT SIZE=3D2>problem.&nbsp; The problem is that if I have tables =
like:</FONT>
<BR><FONT SIZE=3D2>Table1</FONT>
<BR><FONT SIZE=3D2>------</FONT>
<BR><FONT SIZE=3D2>id</FONT>
<BR><FONT SIZE=3D2>name</FONT>
<BR><FONT SIZE=3D2>desc</FONT>
</P>

<P><FONT SIZE=3D2>Table2</FONT>
<BR><FONT SIZE=3D2>------</FONT>
<BR><FONT SIZE=3D2>id</FONT>
<BR><FONT SIZE=3D2>Table1ID&nbsp;&nbsp; &lt;-- Foreign Key thrown in =
for fun.</FONT>
<BR><FONT SIZE=3D2>name</FONT>
<BR><FONT SIZE=3D2>desc</FONT>
</P>

<P><FONT SIZE=3D2>And I join them, then I MUST rename all the selects =
using AS:</FONT>
<BR><FONT SIZE=3D2>select</FONT>
<BR><FONT SIZE=3D2>&nbsp; Table1.id as id1</FONT>
<BR><FONT SIZE=3D2>&nbsp; Table1.name as name1</FONT>
<BR><FONT SIZE=3D2>...etc....</FONT>
</P>

<P><FONT SIZE=3D2>Because I can't have zsql put the variables in the =
caller's</FONT>
<BR><FONT SIZE=3D2>namespace as &quot;Table1.id&quot;.&nbsp; It puts =
them in as &quot;id&quot; (without the AS).</FONT>
</P>

<P><FONT SIZE=3D2>Fortunately, I found the column for sqltest (which is =
the other end</FONT>
<BR><FONT SIZE=3D2>of ZSQL):</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-sqltest id1 column=3D&quot;Table1.id&quot; =
....</FONT>
</P>

<P><FONT SIZE=3D2>&gt; &gt; &gt;</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; &gt; What's the point?&nbsp; ZSQL sucks, =
how do I talk to the DB directly?</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Grab the Python database adapter and write some =
python classes or</FONT>
<BR><FONT SIZE=3D2>&gt; external methods to do what you need.</FONT>
</P>

<P><FONT SIZE=3D2>Can I use them from a python script?&nbsp; If not, =
what's the point?&nbsp; I</FONT>
<BR><FONT SIZE=3D2>mean: External methods are nice to have when you =
have *no other</FONT>
<BR><FONT SIZE=3D2>choice*, but they aren't something I'd want to debug =
and deal with</FONT>
<BR><FONT SIZE=3D2>for object.</FONT>
</P>

<P><FONT SIZE=3D2>&gt; &gt; This makes things work MUCH better.&nbsp; =
So there are work arounds.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; This isn't a work-around, it is the way that it =
is intended to be used.</FONT>
</P>

<P><FONT SIZE=3D2>I didn't see a single example of it.&nbsp; The Zope =
Book didn't mention</FONT>
<BR><FONT SIZE=3D2>this at all (except as a single line =
reference).&nbsp; I would *never*</FONT>
<BR><FONT SIZE=3D2>have gone looking for the word column.&nbsp; Why? =
It's a field!</FONT>
</P>

<P><FONT SIZE=3D2>&gt; Again, I think that it's a matter of =
understanding how ZSQL works,</FONT>
<BR><FONT SIZE=3D2>&gt; rather than a limitation of ZSQL.&nbsp; If you =
have column name conflicts,</FONT>
<BR><FONT SIZE=3D2>&gt; you can always use something like:</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; SELECT a.field as a_field, b.field as b_field =
FROM ...</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Then refer to them in dtml like =
&amp;dtml-a_field; or &lt;dtml-var</FONT>
<BR><FONT SIZE=3D2>&gt; name=3D&quot;a_field&quot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2>Right, but you still have to do extra work to get =
them back into a</FONT>
<BR><FONT SIZE=3D2>ZSQL object.&nbsp; column lets you do that.&nbsp; =
It's got no examples to help</FONT>
<BR><FONT SIZE=3D2>out with.&nbsp; It's documented once.&nbsp; I didn't =
see it.&nbsp; Life is better</FONT>
<BR><FONT SIZE=3D2>now.</FONT>
</P>

<P><FONT SIZE=3D2>&gt; &gt; I still would love some examples.&nbsp; Do =
people end up with 4 ZSQL</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; objects per thing they manipulate in their =
database?:</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; UPDATE, SELECT, INSERT and DELETE?&nbsp; =
Or do they mix them somehow?</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; I typically wind up with a ZSQL method for each =
of the CRUD operations. </FONT>
<BR><FONT SIZE=3D2>&gt; Sometimes I have separate selects methods for =
more complex joins, if the</FONT>
<BR><FONT SIZE=3D2>&gt; DTML code gets too ugly when I try to combine =
them into a single method.</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Example of a fairly typical join statement (for =
MySQL database):</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Arguments-</FONT>
<BR><FONT SIZE=3D2>&gt; begin_date:date =
end_date:date=3D&quot;2037-01-01&quot;</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; SELECT search_string, search_result,&nbsp; =
search_date, result_category,</FONT>
<BR><FONT SIZE=3D2>&gt; legal_category.name</FONT>
<BR><FONT SIZE=3D2>&gt; FROM search_log LEFT JOIN legal_category =
ON</FONT>
<BR><FONT SIZE=3D2>&gt; =
search_log.result_category=3Dlegal_category.code</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; &lt;dtml-sqlgroup required where&gt;</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp; &lt;dtml-sqltest =
name=3D&quot;begin_date&quot; op=3D&quot;gt&quot; =
type=3D&quot;nb&quot;</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
column=3D&quot;search_date&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; &lt;dtml-and&gt;</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp; &lt;dtml-sqltest =
name=3D&quot;end_date&quot; type=3D&quot;nb&quot; =
op=3D&quot;lt&quot;</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
column=3D&quot;search_date&quot; optional&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; &lt;/dtml-sqlgroup&gt;</FONT>
</P>

<P><FONT SIZE=3D2>Hey!&nbsp; An example!</FONT>
</P>

<P><FONT SIZE=3D2>&gt; Good Luck</FONT>
</P>

<P><FONT SIZE=3D2>Thanks.&nbsp; So I'm still having trouble.&nbsp; I =
can't get any of the list</FONT>
<BR><FONT SIZE=3D2>examples to work.</FONT>
</P>

<P><FONT SIZE=3D2>I build a select multiple list, and then try to =
dtml-in on it.&nbsp; It</FONT>
<BR><FONT SIZE=3D2>doesn't seem to work.&nbsp; REQUEST shows in it th =
other and form</FONT>
<BR><FONT SIZE=3D2>namespaces, as a list, but I can't actually dtml-var =
it or anything.</FONT>
</P>

<P><FONT SIZE=3D2>Example:</FONT>
<BR><FONT SIZE=3D2>q&lt;dtml-var dalist&gt;p</FONT>
<BR><FONT SIZE=3D2>&lt;br&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-in VirtualRootPhysicalPath&gt;</FONT>
<BR><FONT SIZE=3D2>d&lt;dtml-var sequence-item&gt;b</FONT>
<BR><FONT SIZE=3D2>&lt;/dtml-in&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;hr&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-var REQUEST&gt;</FONT>
</P>

<P><FONT SIZE=3D2>If you call this with this URL (substitute as =
needed):</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://docwhat.gerf.org:9673/links/test?dalist%0D%0A%3Alist=3D1&=
dalist%0D%0A%3Alist=3D3&dalist%0D%0A%3Alist=3D8" =
TARGET=3D"_blank">http://docwhat.gerf.org:9673/links/test?dalist%0D%0A%3=
Alist=3D1&dalist%0D%0A%3Alist=3D3&dalist%0D%0A%3Alist=3D8</A></FONT>
</P>

<P><FONT SIZE=3D2>Which is the URL pattern formed by a &lt;SELECT =
name=3D&quot;dalist:list&quot;</FONT>
<BR><FONT SIZE=3D2>multiple&gt;....</FONT>
</P>

<P><FONT SIZE=3D2>Then you get errors on dalist.&nbsp; The examples =
at</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://www.zope.org/Members/AlexR/SelectionLists" =
TARGET=3D"_blank">http://www.zope.org/Members/AlexR/SelectionLists</A></=
FONT>
</P>

<P><FONT SIZE=3D2>Don't work as exactl above.</FONT>
</P>

<P><FONT SIZE=3D2>Help?</FONT>
</P>

<P><FONT SIZE=3D2>Ciao!</FONT>
</P>

<P><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Outside of a dog, a book is a man's best =
friend.&nbsp; Inside a dog it's too dark to read.</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>-- =
Groucho Marx</FONT>
</P>

<P><FONT SIZE=3D2>The Doctor What: Need I say =
more?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp; <A HREF=3D"http://docwhat.gerf.org/" =
TARGET=3D"_blank">http://docwhat.gerf.org/</A></FONT>
<BR><FONT =
SIZE=3D2>docwhat@gerf.org&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KF6VNC</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C0C981.9B7C1790--