首页 > 代码库 > Create function through MySQLdb
Create function through MySQLdb
http://stackoverflow.com/questions/745538/create-function-through-mysqldb
How can I define a multi-statement function or procedure in using the MySQLdb lib in python? Example:
Which creates the following traceback:
If I copy the same SQL directly into a mysql shell client, it works as expected python mysql
| |||
add a comment |
3 Answers
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