[egenix-users] mxodbc_zope_da_1.0.9 problem: KeyError, query

RJ Juneau rj at maxxian.com
Thu May 5 09:37:42 CEST 2005



More interesting info on the problem:

If I execute the query directly in the "test" window of the base eGenix
mxODBC Database Connection window, it works fine and returns the 20
lines expected. That could point to a problem in the rendering, which
seems to be where the traceback ends.

Note that within the same Zope system I also have an ODBC connection to
a Sybase database, and I have successfully tested multi-line ZSQL
queries there.

This is the traceback:

	Time	2005/05/05 07:55:15.294 GMT-4	

	Exception Type	KeyError	
	Exception Value	'query'	

	Traceback (innermost last): 
	Module ZPublisher.Publish, line 101, in publish
	Module ZPublisher.mapply, line 88, in mapply
	Module ZPublisher.Publish, line 39, in call_object
	Module Shared.DC.ZRDB.DA, line 337, in manage_test
	Module DocumentTemplate.DT_String, line 474, in __call__
	Module DocumentTemplate.DT_In, line 602, in renderwb
	Module DocumentTemplate.DT_Var, line 219, in render
	KeyError: 'query'

I don't think the following is an issue, but I'll include it for
completeness.I am also getting the following iODBC warnings and errors
in the Zope console log, which are related to the ODBC parameters being
passed by iODBC. Note that these errors also appear for all of the
successful queries.

	[MYODBCUtilReadDataSource.c][205][ERROR] Unknown attribute
(Setup).
	[MYODBCUtilReadDataSource.c][205][ERROR] Unknown attribute
(UsageCount).
	[MYODBCUtilReadDataSource.c][209][WARNING] Failed to get value
for attribute (CP Timeout).
	[MYODBCUtilReadDataSource.c][209][WARNING] Failed to get value
for attribute (CP Reuse).

As for the ZSQL snippet from the template... Since there's no template
involved yet (I'm still testing directly from the ZSQL method), I assume
you mean the SQL code?

	select h.host_name,
	s.system_name, s.system_handle, count(*)
	from terminal t, system_map s, host h
	where
	t.system_index = s.system_index
	and s.host_index = h.host_index
	group by s.system_name
	order by h.host_name

Nothing complicated here. There are no parameters passed to the query.

RJ







-----Original Message-----
From: M.-A. Lemburg [mailto:mal at egenix.com] 
Sent: May 5, 2005 5:38 AM
To: RJ Juneau
Cc: egenix-users at lists.egenix.com
Subject: Re: [egenix-users] mxodbc_zope_da_1.0.9 problem: KeyError,
query


RJ Juneau wrote:
> I'm on the 30 day evaluation for mxodbc_zope_da.
>  
> I'm getting the following error when I  submit some queries:
>  
>     Error Type: KeyError
>     Error Value: 'query'
>  
> I'm using 1.0.9 because the default Python install on my Linux is
> 2.3.4 with UCS4.
>  
> The error seems to be caused by multiple rows being returned.

Could you provide the traceback that came along with the message ?

It would also help, if you could provide the Z SQL method snippet that
you have in the page template.

> I did see an earlier posting with the same error message. The response
> suggested a template error, but this is clearly not the case here.
>  
> The additional evidence I've gathered so far:
>  
> - I'm running the test directly from the ZSQL method, so there's no
> template involved.
> - If I use the same query with an additional "where" clause to ensure 
> that only one row is returned, it works
> - If I use a  value in the 'where' clause with no rows returned, it 
> works
> - The same ZSQL query is being used on a Windows machine running Zope 
> and the free ZODBC module without a problem
> - The query has been verified directly in mysql-client-browser
>  
> Other info:
>  
> - The database is MySQL 4.1.10A-0
> - iODBC is the DB driver
>  
> RJ Juneau
>  
>  
>  
>  
> 
> 
> 
> ----------------------------------------------------------------------
> --
> 
>
_______________________________________________________________________
> eGenix.com User Mailing List
http://www.egenix.com/
> 
> List subscription management:
> https://www.egenix.com/mailman/listinfo/egenix-users

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, May 05 2005)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

This mail is marked as non spam by Pinjo revealer, spamfilter
technology. ( http://www.pinjo.nl )



More information about the egenix-users mailing list