[Zope-DB] Zsql method calling MAX
Julián Muñoz
jmunoz@telefonica.net
Wed, 19 Jun 2002 19:03:11 +0000 (GMT)
I am doing a call to this zsql method, using ZODBC DA (pointing to a .MDB)
over Windows 2000 :
select MAX(ComprasFacturaNumero) as max_bill from ComprasFacturaTabla
The problem is that on this moment, the ComprasFacturaTable is empty.
It seems to have a bug here, here is the output of the following python
script:
res=<Shared.DC.ZRDB.RDB.DatabaseResults instance at 01A11C7C>,lenres=1,
res[0].max_bill=
And If I uncomment the last line:
Zope Error
Zope has encountered an error while publishing this resource.
Error Type: TypeError
Error Value: len() of unsized object
#####
# Call the zsql method
res=container.last_buybill()
def find_type(lll):
if same_type(lll, []):
raise "Error", "fdsf"
if same_type(lll, None):
raise "Error", "None"
if same_type(lll, ' '):
raise "Error", "ggg"
if same_type(lll, " "):
raise "Error", "ff"
if same_type(lll, 1.0):
raise "Error", "1.0"
if same_type(lll, 1):
raise "Error", "1"
if same_type(lll, {}):
raise "Error", "{}"
if same_type(lll, ()):
raise "Error", "()"
if same_type(lll, 0L):
raise "Error", "OL"
find_type(res[0].max_bill)
if res[0].max_bill == None:
print "Ehho"
if res[0].max_bill == ():
print "Ehho"
if res[0].max_bill == '':
print "Ehho"
if res[0].max_bill == []:
print "Ehho"
print "res=%s,lenres=%s, res[0].max_bill=%s"%(res , len(res),
res[0].max_bill )
# print "len(res[0].max_bill)=%s"%len(res[0].max_bill)
return printed
--
__o
_ \<_
(_)/(_)
Saludos de Julián
EA4ACL
-.-
Foro Wireless Madrid
http://opennetworks.rg3.net