[Zope] help with dtml and sql---counting database rows with sql
method
Sean Kelley
sean@horse101.com
Sat, 19 Apr 2003 11:02:08 -0700
--------------080207060202040508050701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by bfish.hurrah.com id h3JI2GX03166
Thanks- I tried this and get the error:
<Shared.DC.ZRDB.Results.Results instance at 0x9fc69cc>
Any ideas what this means?
Dario Lopez-K=E4sten wrote:
>----- Original Message -----
>From: "Kelley, Sean" <SKelley@ci.santa-rosa.ca.us>
>To: <zope@zope.org>
>Cc: <sean@horse101.com>
>Sent: Friday, April 18, 2003 12:55 AM
>Subject: [Zope] help with dtml and sql---counting database rows with sql
>method
>
>
>
>...snip...
>
>
> =20
>
>>This query works outside of zope but returns an error that no column na=
me
>> =20
>>
>is
> =20
>
>>assigned to the value. So I name to the resultant column:
>>
>>SELECT count(*) as p2_count
>>FROM IWPLNCHK
>> =20
>>
>
>Use this query, but call it with <dtml-var counter>. That will give you
>access to the value of p2_count, like this (assuming there are 123 recor=
ds
>in the db):
>
>There are <dtml-var counter> records in the database
>
>will give you
>
>There are 123 records in the database
>
>
>HTH,
>
>/dario
>
>
> =20
>
--------------080207060202040508050701
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
Thanks- I tried this and get the error:<br>
<Shared.DC.ZRDB.Results.Results instance at 0x9fc69cc><br>
Any ideas what this means?<br>
<br>
Dario Lopez-Kästen wrote:<br>
<blockquote type="cite" cite="mid003e01c30598$e1a54b20$2135b5d4@WALTER">
<pre wrap="">----- Original Message -----
From: "Kelley, Sean" <a class="moz-txt-link-rfc2396E" href="mailto:SKelley@ci.santa-rosa.ca.us"><SKelley@ci.santa-rosa.ca.us></a>
To: <a class="moz-txt-link-rfc2396E" href="mailto:zope@zope.org"><zope@zope.org></a>
Cc: <a class="moz-txt-link-rfc2396E" href="mailto:sean@horse101.com"><sean@horse101.com></a>
Sent: Friday, April 18, 2003 12:55 AM
Subject: [Zope] help with dtml and sql---counting database rows with sql
method
...snip...
</pre>
<blockquote type="cite">
<pre wrap="">This query works outside of zope but returns an error that no column name
</pre>
</blockquote>
<pre wrap=""><!---->is
</pre>
<blockquote type="cite">
<pre wrap="">assigned to the value. So I name to the resultant column:
SELECT count(*) as p2_count
FROM IWPLNCHK
</pre>
</blockquote>
<pre wrap=""><!---->
Use this query, but call it with <dtml-var counter>. That will give you
access to the value of p2_count, like this (assuming there are 123 records
in the db):
There are <dtml-var counter> records in the database
will give you
There are 123 records in the database
HTH,
/dario
</pre>
</blockquote>
<br>
</body>
</html>
--------------080207060202040508050701--