本文实例讲述了python调用mysql存储过程并获得返回值的方法。分享给大家供大家参考。具体实现方法如下:
try:
conn = MySQLdb.connect (
host = 'localhost',
user = 'root',
passwd = 'pass',
db = 'prod',
port = 3306
)
cursor1=conn.cursor()
cursor1.execute("CALL error_test_proc()")
cursor1.close()
except MySQLdb.Error, e:
print "Mysql Error %d: %s" % (e.args[0], e.args[1])
希望本文所述对大家的Python程序设计有所帮助。
python怎么学习?python怎么入门?python在哪学?python怎么学才快?不用担心,这里为大家提供了python速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号