擅长:python、mysql、java
<p>这与python操作符有关。我使用python%操作符正确地输入了所有的sql参数,它起作用了。像这样</p>
<pre><code>roomTypeSQL = "SELECT spftype FROM cameron_toll_spatialfeatures WHERE ST_Contains(ST_GeomFromText(%s),ST_geomFromWKB(geometry))=%s;"
roomTypeData = (pointTested,'t') # "POINT(-3.164005 55.926378)"
.execute(roomTypeSQL, roomTypeData)
</code></pre>
<p>python操作符有时会非常令人沮丧。它并不总是如预期的那样工作。我有一些SQL命令的例子,在这些例子中,我不得不将参数直接放在SQL命令中。尽管在Python文档中不建议使用这种方法,但是这种方法仍然有效。在</p>