Python简单调用MySQL存储过程并获得返回值的方法
本文实例讲述了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程序设计有所帮助。
相关推荐
Omega 2020-08-16
zjyzz 2020-08-16
minggehenhao 2020-07-28
zhaojp0 2020-06-27
zjuwangleicn 2020-06-25
wenjieyatou 2020-06-17
liaomingwu 2020-06-16
hungzz 2020-06-16
muzirigel 2020-06-14
gsmfan 2020-06-14
ncomoon 2020-06-14
xiaobaif 2020-06-13
Rain 2020-06-12
hanshangzhi 2020-06-12
talkingDB 2020-06-12
IBMRational 2020-06-09
snowguy 2020-06-01