时间:2021-07-01 10:21:17 帮助过:10人阅读
Which creates the following traceback:
- <code><span class="typ">Traceback<span class="pln"> <span class="pun">(<span class="pln">most recent call <span class="kwd">last<span class="pun">):<span class="pln">
- <span class="typ">File<span class="pln"> <span class="str">"proof.py"<span class="pun">,<span class="pln"> line <span class="lit">21<span class="pun">,<span class="pln"> <span class="kwd">in<span class="pln"> <span class="str"><module><span class="pln">
- DELIMITER <span class="pun">;<span class="str">""")
- File "<span class="pln">build<span class="pun">/<span class="pln">bdist<span class="pun">.<span class="pln">macosx<span class="pun">-<span class="lit">10.5<span class="pun">-<span class="pln">i386<span class="pun">/<span class="pln">egg<span class="pun">/<span class="typ">MySQLdb<span class="pun">/<span class="pln">cursors<span class="pun">.<span class="pln">py<span class="str">", line 173, in execute
- File "<span class="pln">build<span class="pun">/<span class="pln">bdist<span class="pun">.<span class="pln">macosx<span class="pun">-<span class="lit">10.5<span class="pun">-<span class="pln">i386<span class="pun">/<span class="pln">egg<span class="pun">/<span class="typ">MySQLdb<span class="pun">/<span class="pln">connections<span class="pun">.<span class="pln">py<span class="str">", line 35, in defaulterrorhandler
- _mysql_exceptions.ProgrammingError: (1064, "<span class="typ">You<span class="pln"> have an error <span class="kwd">in<span class="pln"> your SQL syntax<span class="pun">;<span class="pln"> check the manual that corresponds to your <span class="typ">MySQL<span class="pln"> server version <span class="kwd">for<span class="pln"> the right syntax to <span class="kwd">use<span class="pln"> near <span class="str">‘DELIMITER //\nCREATE FUNCTION trivial_func (radius float) \n RETURNS FLOAT\n\n ‘<span class="pln"> at line <span class="lit">1<span class="str">")</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code>
If I copy the same SQL directly into a mysql shell client, it works as expected
python mysqlbluish 9,4091269126 | asked Apr 13 ‘09 at 21:54 ???u 23k2070111 |
up vote15down voteaccepted |
The The purpose of
Since the API typically allows you to submit one SQL statement at a time, there‘s no ambiguity -- the interface knows that any semicolons inside the body of your function definition don‘t terminate the whole |
Create function through MySQLdb
标签: