RE: [Zope] Accessing individual items within a list
[McDonnell, Larry]
... But I see this error:
Error Type: NameError Error Value: global name 'pbtemp' is not defined
The zsql is as follows:
update atp_fields
set pbtemp=<dtml-if pbtemp><dtml-if "pbtemp==''">NULL<dtml-else> <dtml-sqlvar pbtemp type=float></dtml-if><dtml-else>NULL</dtml-if>
where serial_number=<dtml-sqlvar serial_number type="string"> and cell_stack_number=<dtml-sqlvar cell_stack_number type="int">
The zsql works when I test it. At first I was just trying to display the values of pbtemp[x], but Alexis gave me zsql call statement so I that is where I am at now.
You have to tell your zsql method what parameters to use, and you have to pass it those parameters. I do not see where you do that, and that is probably why the method does not know about the variable. Within the zsql method, you refer to the parameters by the names you gave them when you added them to the method definition. Also, in the outer code, pbtemp seems to be a dictionary, where as in the zsql method you are treating it as a simple scalar value. So when you do get wi working, in the future you may get confused by the name. I would suggest using a different name for that variable to avoid the confusion. Cheers, Tom P
participants (1)
-
Passin, Tom