时间:2021-07-01 10:21:17 帮助过:10人阅读
Which creates the following traceback:
Traceback (most recent call last):
File "proof.py", line 21, in <module>
DELIMITER ;""")
File "build/bdist.macosx-10.5-i386/egg/MySQLdb/cursors.py", line 173, in execute
File "build/bdist.macosx-10.5-i386/egg/MySQLdb/connections.py", line 35, in defaulterrorhandler
_mysql_exceptions.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 ‘DELIMITER //\nCREATE FUNCTION trivial_func (radius float) \n RETURNS FLOAT\n\n ‘ at line 1")
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
标签: