Ivan Stout wrote at 2005-11-11 23:50 +0900:
>I would like to insert the results of a query into another table and am
>doing this from a python script. I am setting the results of a queryequal to
>a variable with the following:
>
>variable = container.zsql_method(paramater=value)[0][0]
>
>This gives the results I want (in this case "0"), but when I try to insert
>this variable using another zsql method, I get the following error:
>
>"MySQL server version for the right syntax to use near '0\n)'"

Looks like a stupid error message (I though, only MS and Oracle would
produce such stupidies).

>The value I want is there, but it has a newline character also. I try
>removing using .replace but then I get the following error:
>
>'long' object has no attribute 'replace'

Thus, obviously, your "variable" is not a string but a long and
a long does not have a newline appended.
Your problem must come from elsewhere.

"ZSQL Method"s support a "src__" argument.
If you pass it with a Python true value (e.g. "1"), then
the ZSQL Method is not executed but the generate SQL command
returned as source. Carefully look at this source and
find out why it is wrong.

-- 
Dieter
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to