代码:通过cursor方式调用
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
connection = db.engine.raw_connection()
cursor = connection.cursor()
cursor.callproc('sp_getUsers')
for result in cursor.stored_results():
print(result.fetchall())
本文介绍如何使用Flask-SQLAlchemy框架通过cursor方式调用数据库存储过程,展示了一个具体的Python代码示例,该示例演示了连接数据库、调用存储过程并打印查询结果的过程。
代码:通过cursor方式调用
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
connection = db.engine.raw_connection()
cursor = connection.cursor()
cursor.callproc('sp_getUsers')
for result in cursor.stored_results():
print(result.fetchall())
您可能感兴趣的与本文相关的镜像
Llama Factory
LLaMA Factory 是一个简单易用且高效的大型语言模型(Large Language Model)训练与微调平台。通过 LLaMA Factory,可以在无需编写任何代码的前提下,在本地完成上百种预训练模型的微调

被折叠的 条评论
为什么被折叠?