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 &quot;long object&quot; 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> &lt;<a href="mailto:peter@fry-it.com">peter@fry-it.com</a>&gt; 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 &lt;<a href="mailto:aibanhamano@gmail.com">aibanhamano@gmail.com</a>&gt; wrote:<br>&gt; Greetings,<br>&gt;<br>&gt;&nbsp;&nbsp;I would like to insert the results of a query into another table and am<br>&gt; doing this from a python script. I am setting the results of a queryequal to
<br>&gt; a variable with the following:<br>&gt;<br>&gt;&nbsp;&nbsp;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>&gt;<br>&gt;&nbsp;&nbsp;This gives the results I want (in this case &quot;0&quot;), but when I try to insert<br>&gt; this variable using another zsql method, I get the following error:
<br>&gt;<br>&gt;&nbsp;&nbsp;&quot;MySQL server version for the right syntax to use near '0\n)'&quot;<br>&gt;<br>&gt;&nbsp;&nbsp;The value I want is there, but it has a newline character also. I try<br>&gt; removing using .replace but then I get the following error:
<br>&gt;<br>&gt;&nbsp;&nbsp;'long' object has no attribute 'replace'<br>&gt;<br>&gt;&nbsp;&nbsp;I would greatly appreciate it if someone could point me in the right<br>&gt; direction.<br>&gt;<br>&gt;&nbsp;&nbsp;Than you very much,<br>&gt;<br>&gt;&nbsp;&nbsp;Ivan
<br>&gt;<br>&gt; _______________________________________________<br>&gt; Zope maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Zope@zope.org">Zope@zope.org</a><br>&gt; <a href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope
</a><br>&gt; **&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp;&nbsp;**<br>&gt; (Related lists -<br>&gt;&nbsp;&nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>&gt;&nbsp;&nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-dev">
http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>&gt;<br>&gt;<br>&gt;<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>