千万进来看一看!!!有大麻烦了 谢谢谢谢再谢谢----陈年老问题 清囊
我想完成这样一个功能,
table1 : oid(number),value(number) 在加上其他的字段
select * from table a where oid in (...)
其中(...)有可能有很多值(上万或上十万),且无规律,也不是从别的表查询出来的。
因此用in的语法是不行的。但因为这个语句要经常执行,所以用临时表或视图的方式
也是不行的。我现在的想法是用一个varray类型,大概如下
create type my_array of number;
declare
v my_array;
c number;
begin
....--这表示往v中设置了我所要的oid。
select value into c from a where a.oid in TABLE(v);
end;
但是TABLE(v)不能转换成一个列或表来使用????
有什么高见吗?
这个问题很久以前就提过,可每人解答