作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试从 txpostgres 中的存储过程中获取游标。Psycopg2 有一个命名的游标,可以正常工作。但是txpostgres中没有curs = conn.cursor('name')
语句。
还有其他方法吗?
最佳答案
txpostgres 没有命名游标功能。但是,psycopg2 的命名游标只是 PostgreSQL's cursors 的便利包装器。 .我对存储过程没有太多经验,但这里有一个简单查询的示例:
@inlineCallbacks
def transaction(cursor):
yield cursor.execute('mycursor CURSOR FOR SELECT bigtable')
yield cursor.execute('FETCH ALL FROM mycursor')
data = yield cursor.fetchall()
conn.runInteraction(transaction)
关于python - txpostgres 存储过程返回游标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24350136/
我正在尝试从 txpostgres 中的存储过程中获取游标。Psycopg2 有一个命名的游标,可以正常工作。但是txpostgres中没有curs = conn.cursor('name')语句。
我们有一个 RESTful(-ish) 扭曲的应用程序,它使用 txpostgres 访问 postgres 数据库。目前,每次客户端 ping 服务器以进行数据库调用时,我们都会生成新的 txpos
我是一名优秀的程序员,十分优秀!