自定义类型: create or replace type arry_number as table of number(15);以下是函数片段:l_data arry_number := arry_number();update t_config
set configvalue =1
where configtype = 2
returnning configid
bulk collect
into l_data --这里已经取到值了。。open p_cursor for
select t.configid form t_config t where t.configid in (
select column_value
from TABLE ( cast ( l_data as arry_number) )
这一段代码不能获取到值,不知道是cast有问题,还是select语句有问题
);
说明:
语法没有问题。编译也通过了。现在的问题是最后那一段获取不到值,不知道是cast转换有问题,还是哪里有问题,有没有牛人帮忙解决以下问题。。很急,在线等。
set configvalue =1
where configtype = 2
returnning configid
bulk collect
into l_data --这里已经取到值了。。open p_cursor for
select t.configid form t_config t where t.configid in (
select column_value
from TABLE ( cast ( l_data as arry_number) )
这一段代码不能获取到值,不知道是cast有问题,还是select语句有问题
);
说明:
语法没有问题。编译也通过了。现在的问题是最后那一段获取不到值,不知道是cast转换有问题,还是哪里有问题,有没有牛人帮忙解决以下问题。。很急,在线等。
解决方案 »
- 求这样的视图
- 请教ORACLE10g 连接 SYBASE 建立透明网关
- 数据库从Oracle9升级到Oracle10,jdk1.4升级到jdk1.6时,原有的java程序如何改呢?
- 求一句sql,关于两个库的数据转移
- 求一位能写复杂类型储存过程的高手帮忙(在线等.....)
- oracle 中导入dmp文件,导不进去
- 一个很急的问题
- 在oracle里面我怎样取两条或更多相同的记录100分
- 请教各位 哪有关于oracle sql语法的祥解 下载啊
- windows2000 server 下oracle9i安装不了,望高手指点!
- 求一个Excel导入高效校验方式
- 如何将动态sql应用到for loop循环中?
2 l_data arry_number := arry_number();
3 type p_cursor_type is ref cursor;
4 p_cursor p_cursor_type;
5 v_configid t_config.configid%type;
6 begin
7 update t_config set configvalue =1 where configtype = 2
8 returning configid bulk collect into l_data;
9 open p_cursor for select t.configid from t_config t where t.configid in (
10 select column_value from TABLE(l_data));
11 fetch p_cursor into v_configid;
12 while p_cursor%found loop
13 dbms_output.put_line(v_configid);
14 fetch p_cursor into v_configid;
15 end loop;
16 close p_cursor;
17 end;
18 /
11
12
13
14
15
15PL/SQL 过程已成功完成。SQL> commit;提交完成。SQL> select * from t_config
2 / CONFIGID CONFIGVALUE CONFIGTYPE
---------- ----------- ----------
1 1 1
2 2 1
3 3 1
4 4 1
5 5 1
6 6 1
7 7 1
8 8 1
9 9 1
10 10 1
11 1 2 CONFIGID CONFIGVALUE CONFIGTYPE
---------- ----------- ----------
12 1 2
13 1 2
14 1 2
15 1 2
15 15 3
16 16 3
17 17 3
18 18 3已选择19行。
--自己看吧