Create or Replace procedure p_getstring (p_finalstring out varchar2, p_rulestring in number, p_sourcestring in VARCHAR2) as V_num number:=1; V_resoucenum number:=1; V_getnum number; V_getsting VARCHAR2 (2000); V_errorstring exception; V_errorrule exception;begin If Length (p_sourcestring) < then raise v_errorstring; else p_finalstring:= '; Loop V_getnum: = substr (p_rulestring, V_num, 1); --Get the numbers from rule v_getsting: = substr (p_sourcestring, V_resoucenum, v_getnum); --according to the rule number to get the short String v_resoucenum: = V_resoucenum + v_getnum; -The number of the next short string start position v_num: = V_num + 1; P_finalstring: = P_finalstring| | V_getsting| | ' /‘; --Splice The short string to the final string dbms_output.put_line (V_resoucenum); If substr (p_rulestring, V_num, 1) is null then exit; End If; End Loop; if (v_resoucenum-1) < or (v_resoucenum-1) > Raise v_errorrule; End If; P_finalstring: = substr (p_finalstring, 1, Length (p_finalstring)-1); End If; Exception when v_errorstring then p_finalstring:= ' The String length was less than 18! '; When V_errorrule then p_finalstring:= ' The sum value of the rule numbers less than or more then 18! '; When others and then p_finalstring:= ' others wrong '; End p_getstring;
Based on 23,423 pieces, intercept the field ' Abdecsdsadsadsad ' to ab/dec/sdsa/ds/ads output