-- Создание таблицы t
create table t as
(select to_number(regexp_substr(id,'[^,]+',1,level)) as id,
trim(regexp_substr(pid,'[^,]+',1,level)) as pid,
regexp_substr(nam,'[^,]+',1,level) as nam
from (select '1,2,3,4,5,6,7' as id,
' ,1,1,2,4,5,4' as pid,
'Корень,Узел2,Узел3,Узел4,Узел5,Узел6,Узел7' as nam
from dual)
connect by regexp_substr(id,'[^,]+',1,level) is not null
and regexp_substr(pid,'[^,]+',1,level) is not null
and regexp_substr(nam,'[^,]+',1,level) is not null
);
select * from t