VALUES (3, 'lucy');
INSERT INTO `tmp` VALUES (4, 'james');
INSERT INTO `tmp` VALUES (5, 'jim');
mysql 创建存储过程...set i3 = i3 + 100;
SELECT * FROM tmp;
end $$
delimiter ;
python 调用 mysql 存储过程...pymysql.connect(**PY_MYSQL_CONN_DICT)
cusor = conn.cursor(cursor=pymysql.cursors.DictCursor)
# 调用 p1 存储过程...,传入4个参数
cusor.callproc('p1', args=(1, 2, 3, 4))
# 返回获得的集合,即存储函数中的 SELECT * FROM tmp; 结果
res1 = cusor.fetchall...()
print(res1)
# 以 python 固定格式获取返回的值:@_存储过程名_0, 第一个返回值
cusor.execute("select @_p1_0, @_p1_1, @_p1_2,