Yes, the full error message is the following:<br>
<br>
" ProgrammingError: (1064, "You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near '0\n)' at line 9") "<br>
<br>
Here is the select portion of the query I am running:<br>
<br>
select count(*) as "order"<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;">
What kind of a strange message is that?<br>"MySQL server version for the right syntax to use near '0\n)'"<br>Is that the ErrorValue?<br><br>It can't be converted to a long or in because it contains a ) not<br>because of the \n
<br>What's the SQL you're trying to use? (Only need to see the SELECT ... part)<br><br>On 11/11/05, Ivan Stout <<a href="mailto:aibanhamano@gmail.com">aibanhamano@gmail.com</a>> wrote:<br>> Peter,<br>><br>> Thank you, but unfortunately I still get the same error due to the newline
<br>> character being there and still cannot remove it with variable.replace. Can<br>> a "long object" be converted to a string or integer some way?<br>><br>><br>><br>> On 11/12/05, Peter Bengtsson <
<a href="mailto:peter@fry-it.com">peter@fry-it.com</a>> wrote:<br>> > 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<br>> 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
<br>> 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>> ><br>><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>