Peter,<br>
<br>
Thank you, but unfortunately I still get the same error due to the
newline character being there and still cannot remove it with
variable.replace. Can a "long object" be converted to a string or
integer some way?<br>
<br>
<br><div><span class="gmail_quote">On 11/12/05, <b class="gmail_sendername">Peter Bengtsson</b> <<a href="mailto:peter@fry-it.com">peter@fry-it.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 11/11/05, Ivan Stout <<a href="mailto:aibanhamano@gmail.com">aibanhamano@gmail.com</a>> wrote:<br>> Greetings,<br>><br>> I would like to insert the results of a query into another table and am<br>> doing this from a python script. I am setting the results of a queryequal to
<br>> a variable with the following:<br>><br>> variable = container.zsql_method(paramater=value)[0][0]<br><br>Try getting the field out by name, not number.<br>Eg:<br>variable = container.zsql_method(paramater=value)[0]['count']
<br>or<br>variable = container.zsql_method(paramater=value)[0]['age']<br><br>><br>> This gives the results I want (in this case "0"), but when I try to insert<br>> this variable using another zsql method, I get the following error:
<br>><br>> "MySQL server version for the right syntax to use near '0\n)'"<br>><br>> The value I want is there, but it has a newline character also. I try<br>> removing using .replace but then I get the following error:
<br>><br>> 'long' object has no attribute 'replace'<br>><br>> I would greatly appreciate it if someone could point me in the right<br>> direction.<br>><br>> Than you very much,<br>><br>> Ivan
<br>><br>> _______________________________________________<br>> Zope maillist - <a href="mailto:Zope@zope.org">Zope@zope.org</a><br>> <a href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope
</a><br>> ** No cross posts or HTML encoding! **<br>> (Related lists -<br>> <a href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>> <a href="http://mail.zope.org/mailman/listinfo/zope-dev">
http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>><br>><br>><br><br><br>--<br>Peter Bengtsson,<br>work <a href="http://www.fry-it.com">www.fry-it.com</a><br>home <a href="http://www.peterbe.com">www.peterbe.com
</a><br>hobby <a href="http://www.issuetrackerproduct.com">www.issuetrackerproduct.com</a><br></blockquote></div><br>