Arian,
The query posted above was tested on 10.1.0.3 only, but it is all 9i syntax. I was getting the ORA-3113 when I included the REGEXP_REPLACE. But, I have an 8i version that I also wrote and forgot to post ( the OP asked for all versions ). You could perhaps test this:-
Regards,Code:SELECT RTRIM( str,',' ) AS original_string , SUBSTR( str, start_pos, (next_pos-start_pos) ) AS single_element , element_no FROM ( SELECT ilv.str , nt.column_value AS element_no , INSTR( ilv.str, ',', DECODE( nt.column_value, 1, 0, 1 ), DECODE( nt.column_value, 1, 1, nt.column_value-1 ) ) + 1 AS start_pos , INSTR( ilv.str, ',', 1, DECODE( nt.column_value, 1, 1, nt.column_value ) ) AS next_pos FROM ( SELECT str || ',' AS str , LENGTH( TRANSLATE( UPPER( str ), ',ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890', ',' ) ) + 1 AS no_of_elements FROM t ) ilv , TABLE( CAST( MULTISET( SELECT ROWNUM FROM all_objects WHERE ROWNUM <= ilv.no_of_elements ) AS number_ntt ) ) nt )
Arian, I mean, Adrian...




Reply With Quote