ORA-06575: Package or function SPLIT is in an invalid state
来源:互联网 发布:手机淘宝在那里改地址 编辑:程序博客网 时间:2024/05/19 00:49
oracle中的语句报错:ORA-06575: Package or function SPLIT is in an invalid state
我的语句是这样的:
select * from exams where DISABLED='N' and id in (select * from table(split((select exams from categorys where id=${sample.categoryId}),','))) order by order_no,id
去网上搜意思说split这个函数用错了。可是我在网上看了用法明明就是这么用的,只是名字不太同是fn_split当时以为那是老版的,现在升级了,所以在猜可能不是这个原因,以为是传值或者别的问题,找了半天还是没找到。没办法,继续在网上看。看了好久。突然发现oracle根本就没有字符串分割这个函数,我搜出来的那些是自己写的,所以才会有名字不同这个原因。找到错误就很好就解决了:
自己写一个字符串分割函数:
create or replace type type_split as table of varchar2(500);
create or replace function split
(
p_list varchar2,
p_sep varchar2 := ';'
) return type_split pipelined
is
l_idx pls_integer;
v_list varchar2(500) := p_list;
begin
loop
l_idx := instr(v_list,p_sep);
if l_idx > 0 then
pipe row(substr(v_list,1,l_idx-1));
v_list := substr(v_list,l_idx+length(p_sep));
else
pipe row(v_list);
exit;
end if;
end loop;
return;
end split;
执行后再用代码:
select * from table(split('121212;dfd;dfd;vvv;llll;对方答复',';'));
测试一下,发现就没有报错了。所以说有时候要认真看看。有时间多多了解基础知识。
- ORA-06575: Package or function SPLIT is in an invalid state
- oracle 的自定义的存储函数遇到的 package or function is in an invalid state
- setOutputFormat called in an invalid state: 1
- ORA-20000: index " "." " or partition of such index is in unusable state
- ORA-20000: index " "." " or partition of such index is in unusable state
- ORA-20000 index ...or partition of such index is in unusable state
- ORA-20000: index "FCSASUSER"."IDX_DN_TREE_ID" or partition of such index is in unusable state
- Deprecated: Function split() is deprecated in ... 解决办法
- hadoop1.1.2格式化出错:*is in an inconsistent state: storage directory does not exist or is not accessible
- OUI-10022:The target area /oracle/oraInventory cannot be used because it is in an invalid state.
- 分析和解决 ORA-01502: index '某分区表索引名' or partition of such index is in unusable state
- OGG-00665 (status = 1502-ORA-01502: index 'index' or partition of such index is in unusable state)
- 策略错误 ORA-28100:policy function schema FMIS1600 is invalid.
- Element type is invalid: expected a string (for built-in components) or a class/function (for compos
- is not writable or has an invalid setter method错误
- java.sql.SQLException: OALL8 is in an inconsistent state.
- 一次“ERROR: OALL8 is in an inconsistent state”处理
- ORA-04042 procedure, function, package, or package body does not exist
- eclipse svn 切换项目svn地址
- 一个不错的Jtable实例
- CUBE 和 ROLLUP 之间的具体区别
- SpringMVC接收复杂集合参数
- java 设计模式的开场浅谈
- ORA-06575: Package or function SPLIT is in an invalid state
- OptionsMenu创建方式 以及invalidateOptionsMenu
- 欢迎使用CSDN-markdown编辑器
- android开发之记录ListView滚动位置
- HDU 1274 展开字符串(深搜+字符串,显示缩写的字符串)
- 初创企业CEO要优先考虑的5件事
- hdu 5429 Geometric Progression(高精度)
- 搬运工
- nl80211 & cfg80211 库是如何工作的?