be good if you could pop the complete code up chef, certainly help me along
Ok, clear for now. Next question: Is this to be done in a PL/SQL block or function, or is it an embedded SQL statement somewhere? Thus, what loop mechanism do you (intend to) use?
If you can call a PL/SQL function, the solution might be easy: call the function with the dataset as a parameter, and use the function to create a temporary table with the separate rows, then us a standard SQL loop to read the table and push to the webservice. Sounds like a possibility?
SELECT REGEXP_SUBSTR(DataSet, '[^:cntrl:]+', 1, 1) tmpVal1
, REGEXP_SUBSTR(DataSet, '[^|]+', 1, 1) tmpVal2
, REGEXP_SUBSTR(DataSet, '[^|]+', 1, 2) tmpVal3
, REGEXP_SUBSTR(DataSet, '[^|]+', 1, 3) tmpVal4
, REGEXP_SUBSTR(DataSet, '[^|]+', 1, 4) tmpVal5
, REGEXP_SUBSTR(DataSet, '[^:cntrl:]+', 1, 2) tmpVal6
FROM (SELECT DataSet aString FROM DUAL)
select substr(dataset, 1, instr(dataset, chr(10)))
,substr(dataset, 1, instr(dataset, '|') - 1) tmpVal2
,substr(dataset, instr(dataset, '|') + 1
, instr(dataset, '|', 1, 2)
- instr(dataset,'|', 1, 1) - 1) tmpVal3
,substr(dataset, instr(dataset, '|', 1, 2) + 1
,instr(dataset, '|', 1, 3)
-instr(dataset, '|', 1, 2) - 1) tmpVal4
,nvl(substr(dataset, instr(DataSet, '|', 1, 3) + 1
,instr(dataset, chr(10), 1, 1)
-instr(dataset, '|', 1, 3) - 1), substr(dataset, instr(DataSet, '|', 1, 3) + 1)) tmpVal5
, substr(dataset, instr(dataset, chr(10))) TmpVal6
from (select 'first|12345|version745|99985
second|23456|ver666|68452
third|3456_00|v9864|7777' as dataset from dual)