全部版块 我的主页
论坛 提问 悬赏 求职 新闻 读书 功能一区 经管百科 爱问频道
772 0
2018-03-25
我现在在用python调用oracle的一个接口,但是返回值是一个游标,请问我该如何获取这个游标的具体值啊create or replace package testpackage as
type test_cursor is ref cursor;
end testpackage;
/

create or replace procedure sp_pro3(spdeptno in number,sp_cursor out testpackage.test_cursor)
is
begin
  open sp_cursor for select * from emp where deptno=spdeptno;
end;
/

In [58]: import cx_Oracle as cx

    ...: conn = cx.connect('scott/123456@MissWang/orcl')

    ...: cursor = conn.cursor()

    ...: spdeptno = 10

    ...: sp_cursor = cursor.var(cx.CURSOR)

    ...: cursor.callproc('sp_pro3',[spdeptno,sp_cursor])

Out[58]: [10, <cx_Oracle.Cursor on <cx_Oracle.Connection to scott@MissWang/orcl>>]


请问我该如何获取这个游标的具体值啊


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群