SQL> col s format A180 SQL> SQL> select s from 2 ( select st,extractvalue 3 (column_value ,'/ROW'|| 4 '/EMPNO' ) val,s from ( select 5 s st,/*jkh*/ regexp_replace (rpad( 6 '@',16*length (s),'@'),'(@{15})@', 7 '\'|| (length (s) -9)||'*')s from 8 (select /*[*/ translate(str, max ( 9 sys_connect_by_path(s, ',')), max( 10 sys_connect_by_path(sub2,',')))s from (select 11 row_number() over(order by s) rn, str,s, sub, chr(sub + nvl(decode 12 (sub, 98,3, 101, 16, 104, 11, 105, 11, 109, 2),0)-nvl(decode(sub, 108,8,110,11,112,14 , 13 114,12,115, 18) ,0)) sub2 from (select str , substr (str, level, 1) s, ascii (regexp_substr (str, 14 '.', 1, level)) sub from (with t as (select substr(s, 3, instr(s, substr (s,-4,2),1)) str from (select 15 regexp_replace('comprehensible','((.).*?)\2','\1') s from dual ) ) select * from t) connect by regexp_instr 16 (str, '.', 1, level) > 0)) connect by prior rn /*rwerwewer*/= rn - 1 start with rn = 1 group by str ) ), xmltable 17 ('for $i in ora:view ( "SCOTT", "EMP" ) return $i' COLUMNS id varchar(9) PATH '/ROW/EMPNO/text() 18 ') where decode( sign ( 9 - rownum), 1, ascii( 'O'),0, ascii ( 'B') ) < 99) model 19 partition by (rownum part) dimension by (0 dim) measures ( st, cast (s as varchar2 20 (200)) s, count(*) over () cnt, 0 it) rules iterate (1e3) until (iteration_number+1 = 21 length(st[0])) (cnt[0]=CV(part),it[0]=iteration_number , s[0] = case when ascii (upper( 22 substr( st[0],iteration_number +1, 1) ))= any(79,67 ) then case when CV( 23 part ) in(2,8)then /*sdfsd*/ /**/ regexp_replace(s[0],'.{7}(' 24 || '.*)$',rpad (' ', 7, ' ') ||'\1',iteration_number 25 * 16+5)when CV(part) in ( 3 , 7 ) then 26 decode ( substr( st[0],it 27 [0] +1,1),'o', 28 regexp_replace (s[ 29 0] ,'.{4}(@)@{4}' 30 ||'(.*)$',rpad 31 (' ',4,' ') 32 ||'\1 '|| 33 ' \2',it[0]*16+4), 34 regexp_replace(s 35 [0],'.{4}(..)@{3}(.*)$',' \1 \2',it[0]*16+4)) when cnt[0] between 4 and 6 and substr(st[0],it[0]+1,1)<>'c' then regexp_replace(s[0],'.{3}(@{3})@{3}(.*)$',' \1 \2',it[0]*16+4) 36 when CV(part) not in (1,9) then regexp_replace 37 (s[0],'.{3}' ||'(.*)$' ,' \1',it[0]*16+4) 38 else s[0] end when ascii (upper (substr (st[0],it 39 [0]+1,1 )))=any (69,70)then case when cnt[0] =2 then regexp_replace(s[0], 40 '.{9}(.*)$',lpad (' ',9,' ')||'\1',it[0]*16+4) when CV (part) 41 in (3, 4 ,6 , 7) then regexp_replace(s[0],'.{3}',' ' ,it[0]* 16+4,1) 42 when cnt[0]=5 then regexp_replace(s[0],'.{6}',rpad(' ',6,' '),it[0]*16+4,1) when cnt[0]=8 and substr(st[0],it[0]+1,1)='e' then regexp_replace(s[0],'.{9}(.*)$',lpad(' ',9,' ')||'\1' 43 ,it[0]*16+4) when cnt[0]=8 and substr(st[0],it[0]+1,1)='f' then regexp_replace(s[0],'.{3}',' ',it[0]*16+4,1) else s[0] end when ascii(upper(substr(st[0],it[0]+1,1)))= sqrt(4356) 44 then case when decode(sign(CV(part)-2),0,1,2)=1 then regexp_replace(s[0],'.{7}',rpad(' ',7,' '),it[0]*16+4,1) when cnt[0] in (3,4) then regexp_replace(s[0],'.{3}(@{'||(5-CV(part)) || 45 '}).{'||(6-cnt[0])||'}',' \1'||rpad(' ',6-CV(part),' '),it[0]*16+4,1) when (cnt[0]+CV(part)) = 10 or cnt[0]=8 then regexp_replace(s[0],'.{9}',rpad(' ',9,' '),it[0]*16+4,1) when 46 round((2*cnt[0]+1)/2+0.1*decode(cnt[0],6,1,7,-1)) = 7 then regexp_replace(s[0],'.{10}',' @@@@ ',it[0]*16+4,1) else s[0] end when substr(st[0],it[0]+1,1) = 'a' then decode(cnt[0], 47 2,regexp_replace(s[0],'..@',rpad(' ',3,' '),it[0]*16+7,1), 3,regexp_replace(s[0],'.{3}.@',rpad(' ',5,' '),it[0]*16+6,1), 4,regexp_replace(s[0],'.{7}',rpad(' ',3,' ')||'@'||rpad(' ',3, 48 ' '),it[0]*16+5,1), 5,regexp_replace(s[0],'.{9}',rpad(' ',3,' ')||'@@@'||rpad(' ',3,' '),it[0]*16+4,1),6,regexp_replace(s[0],'.{9}',rpad(' ',9,' '),it[0]*16+4,1), 7,regexp_replace 49 (s[0],'.{9}',rpad(' ',3,' ')||'@@@'||rpad(' ',3,' '),it[0]*16+4,1), 8,regexp_replace(s[0],'.{9}',rpad(' ',3,' ')||'@@@'||rpad(' ',3,' '),it[0]*16+4,1), s[0]) when ascii(translate( 50 substr(st[0],it[0]+1,1),chr(116),'-'))=45 then case when CV(part)=2 then regexp_replace(s[0],'.{9}',rpad(' ',9,' '),it[0]*16+4,1) when cnt[0] between 3 and 8 then regexp_replace(s[0] 51 ,'.{3}',rpad(' ',3,' '),it[0]*16+7,1) else s[0] end when ascii(translate(substr(st[0],it[0]+1,1),chr(117),'!'))=33 then case when CV(part)=8 then regexp_replace(s[0],'.{7}',rpad(' ' 52 ,7,' '),it[0]*16+5,1) when cnt[0] between 2 and 14 and cv(part)<>9 then regexp_replace(s[0],'.{9}',' '||translate(rpad(',',3,','),',',CHR(64))||' ',it[0]*16+4,1) else s[0] end 53 when regexp_substr(st[0],'.',1,it[0]+1)=substr(st[0],-1) then case when CV(part) = any(2,power(2,3)) then substr(s[0],1,it[0]*16+3)||rpad(' ',7,' ')||substr(s[0],it[0]*16+11) when cnt 54 [0] in (3,7) then regexp_replace(s[0],'.{9}',' '||'@@'||' ',it[0]*16+4,1) when CV(part) not in (1,9) then regexp_replace(s[0],'.{9}',' '||'@@@'||' ',it[0]*16+4,1) else s[0] 55 end when CV(part) in (2,5,8) then regexp_replace ( s[0],'.{7}', rpad ( ' ',7 ,' '), it[0]* 16+ 5,1) when CV( part ) in (3,7) then regexp_replace (s[0],'.{9}', rpad (' @@@',9,' ') 56 ,it[0]*16+4,1) when cnt[0]=4 then regexp_replace(s[0],'.{3}',' ',it[0]*16+4 , 1) when cnt[0]=6 then regexp_replace(s[0],'.{3}',' ',it[0]*16+10,1) else s[0] end ) order by cnt 57 / S ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@* @@@@ @@@@*@@@ @@@@@*@@@ @@@*@@@ @@@ @@@*@@@@ @@@@*@@@@ @@@@*@@@@@@ @@@@@@*@@@ @@@*@@@ @@@*@@@ @@@@@* @@@ @ @@@*@@@ @@ @@@@*@@@ @@@@@@@@@*@@@ @@@ @@@*@@@ @@@ @@@*@@@ @@ @@@*@@@@@ @@@@@*@@@@@@ @@@@@@*@@@ @@@@@@@@@*@@@ @@ @@@* @@@ @@@ @@@*@@@ @ @@@@@@*@@@ @@@@@@@@@*@@@ @@@ @@@*@@@ @@@@@@@@@*@@@ @@@@@@@@@*@@@@ @ @@@@*@@@@@@ @@@@@@*@@@ @@@@@@@@@*@@@ @@@ @@@* @@@ @@@ @@@*@@@ @@@*@@@ @@@@@@*@@@ @@@ @@@*@@@@ @@@@*@@@ @@@@@@@@@*@@@ @@@ @@@*@@@@@@ @@@@@@*@@@ @@@@@@*@@@ @@@ @@@* @@@ @@@ @@@*@@@ @@@@ @@*@@@ @@@@@@@@@*@@@ @@@ @@@*@@@@@@@@@ @@@*@@@ @@@@@@@@@*@@@ @@@*@@@@@@ @@@@@@*@@@ @@@@@@@@@*@@@ @@@ @@@* @@@ @ @@@*@@@ @@@@ @@*@@@ @@@@@@@@@*@@@ @@@ @@@*@@@ @@@ @@@*@@@ @@ @@@*@@@ @@@ @@@*@@@@@@ @@@@@@*@@@ @@@@@@@@@*@@@ @@ @@@* @@@@ @@@@*@@@ @@@*@@@ @@@@@@@@@*@@@@ @@@@*@@@@ @@@@*@@@@ @@@@*@@@ @@@ @@@*@@@@@@ @@@@@@*@@@ @@@*@@@ @@@@@* @@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@* 9 rows selected SQL>