in SQL Server you can use XML to solve this:
as long as the number of columns is static, you're fine. It'll handle any number of rows.
There should be similar functionality in Oracle
Code:
declare @dataset varchar(1000) declare @dataxml xml set @dataset ='first|12345|version745|99985 second|23456|ver666|68452 third|3456_00|v9864|7777' select @dataxml =cast('<dataset><row><data>'+replace(replace(replace(@dataset,char(13),''),'|','</data><data>'),CHAR(10),'</data></row><row><data>')+'</data></row></dataset>'as xml) select dataset.a.value('data[1]','varchar(100)')as data1, dataset.a.value('data[2]','varchar(100)')as data2, dataset.a.value('data[3]','varchar(100)')as data3, dataset.a.value('data[4]','varchar(100)')as data4 from @dataxml.nodes('dataset/row')as dataset(a)
There should be similar functionality in Oracle
Comment