打印不了游标啦
时间:2008-04-29
来源:互联网
create or replace procedure ret_cur(
cur in out sys_refcursor) is
begin
open cur for
select to_char(id) id,
name,
to_char(type) "type"
from demo;
end;
--打印存储过程返回的游标
SQL> col name format a12
SQL> variable x refcursor;
REFCURSOR not supported
SQL> exec ret_cur(x);
begin ret_cur(x); end;
ORA-06550: 第 1 行, 第 15 列:
PLS-00201: 必须说明标识符 'X'
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
SQL> print x;
x
---------
SQL>
--oracle9.2 for windows
这个问题咋搞呀
作者: houyichong 发布时间: 2008-04-29
而且错误明明白白的都告诉你了
SQL> variable x refcursor;
REFCURSOR not supported
作者: zhangfengh 发布时间: 2008-04-29
作者: houyichong 发布时间: 2008-04-29
exec ret_cur(:x);
作者: bell6248 发布时间: 2008-04-29
不知道是不是10g才支持refcursor呢
我在9.1,9.2上测试过都不行啦
作者: houyichong 发布时间: 2008-04-30
Oracle9i [9.2.0.1.0 ]
SQL> create or replace procedure ret_cur(cur in out sys_refcursor)
2 is
3 begin
4 open cur for select ename, sal from emp;
5 end;
6 /
Procedure created.
SQL> variable x refcursor;
SQL> exec ret_cur(:x);
PL/SQL procedure successfully completed.
作者: bell6248 发布时间: 2008-04-30
作者: shiguibao 发布时间: 2008-04-30
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> create or replace procedure ret_cur(
2 cur in out sys_refcursor) is
3 begin
4 open cur for
5 select to_char(11) id,
6 'tom' name,
7 to_char(2) type
8 from dual;
9 end;
10 /
过程已创建。
SQL> variable x refcursor
SQL> exec ret_cur(:x)
PL/SQL 过程已成功完成。
SQL> print :x
ID NAM T
-- --- -
11 tom 2
SQL>
作者: shiguibao 发布时间: 2008-04-30
作者: shiguibao 发布时间: 2008-04-30
REFCURSOR not supported
SQL> variable x refcursor;
REFCURSOR not supported
SQL>
作者: houyichong 发布时间: 2008-05-02
但我在oracle的sqlplus测试就出来结果了
连接到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 -
With the Partitioning, OLAP and Oracle Data Mini
JServer Release 9.2.0.1.0 - Production
SQL> variable x refcursor;
SQL> exec ret_cur(:x);
PL/SQL 过程已成功完成。
SQL> print :x;
ID NAME
---------------------------------------- -------
type
----------------------------------------
1 可口可乐
1
2 美年达
1
4 顺连香醋
3
ID NAME
---------------------------------------- -------
type
----------------------------------------
3 泰国大米
2
SQL>
作者: houyichong 发布时间: 2008-05-02
作者: guhan010 发布时间: 2011-09-03
作者: dingjun123 发布时间: 2011-09-03
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28