[Zope] Trouble with ZSQL method

Russell Hires rhires@earthlink.net
Wed, 5 Sep 2001 23:08:13 -0400


You might try sending this to the zope-db@zope.org, which is specifically for 
zope/database type questions....

Russell
On Wednesday 05 September 2001 22:35, you wrote:
> Hello, all.  Apologies in advance for the long lines in the error message.
>
> I'm running Solaris 7, Zope 2.3.3, MySQL 3.23.28-gamma, ZMySQLDA 2.0.7,
> and MySQLdb 0.9.0.
>
> I'm trying to get the following ZSQL method name sql_select_single
>  to work:
>
>   select servicedesc, serviceid as parentid
>   from z_service
>   where <dtml-sqltest servicename op=eq type=string>
>
> Yes, servicename is defined as a parameter.
>
> When I test it manually, it's great.  When I try to test it with
> the following bit of DTML:
>
>   <dtml-let servicename="'CIP'">
>
>   <p class="bodynorm">
>     <dtml-var servicename>
>   </p>
>
>   <dtml-var expr="sql.test_select_single()">
>
>   </dtml-let>
>
> I get the following wonderful error:
>
> Zope Error
> Zope has encountered an error while publishing this resource.
>
> Error Type: Bad Request
> Error Value: ['servicename']
>
> ---------------------------------------------------------------------------
>-----
>
> Troubleshooting Suggestions
>
> The URL may be incorrect.
> The parameters passed to this resource may be incorrect.
> A resource that this resource relies on may be encountering an error.
> For more detailed information about the error, please refer to the HTML
> source for this page.
>
> If the error persists please contact the site maintainer. Thank you for
> your patience.
>
> Traceback (innermost last):
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.p
>y, line 223, in publish_module File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.p
>y, line 187, in publish File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Zope/__init__.py,
> line 221, in zpublisher_exception_hook (Object: Traversable)
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.p
>y, line 171, in publish File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/mapply.py
>, line 160, in mapply (Object: index_html)
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/ZPublisher/Publish.p
>y, line 112, in call_object (Object: index_html)
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py,
> line 189, in __call__ (Object: index_html)
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_
>String.py, line 540, in __call__ (Object: index_html)
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/OFS/DTMLMethod.py,
> line 182, in __call__ (Object: index_docs)
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_
>String.py, line 540, in __call__ (Object: index_docs)
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_
>Let.py, line 149, in render (Object: servicename="'CIP'")
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/DocumentTemplate/DT_
>Util.py, line 339, in eval (Object: sql.sql_select_single())
>     (Info: sql)
>   File <string>, line 0, in ?
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/DA.py
>, line 476, in __call__ (Object: sql_select_single)
>   File
> /usr/local/src/Zope-2.3.3-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/Aqued
>uct.py, line 150, in _argdata (Object: sql_select_single)
> Bad Request: (see above)
>
> What am I doing wrong?