您是第欢迎光临我的主页位访客
浩凡儿
天行健,君子以自强不息;地势坤,君子以厚德载物!

create or replace procedure test
(
jf_Id in nvarchar2,
yf_id in nvarchar2
)

as

v_length NUMBER := LENGTH(yf_id);
v_start NUMBER := 1;
v_index NUMBER;

Begin

WHILE(v_start <= v_length)
LOOP
v_index := INSTR(yf_id, ',', v_start);

IF v_index = 0
THEN
dbms_output.put_line(SUBSTR(yf_id, v_start));
v_start := v_length + 1;
ELSE
dbms_output.put_line(SUBSTR(yf_id, v_start, v_index - v_start));
v_start := v_index + 1;
END IF;
END LOOP;

Exception

When others then

Rollback;

End;

posted on 2016-04-05 13:52  浩凡儿  阅读(452)  评论(0编辑  收藏  举报