'franchise': 'Px Oncology (Solid Tumors, all XA Onc projects)', 'zlinical_xombination_study': 'No'
franchise: Px Oncology (Solid Tumors, all XA Onc projects)
zlinical_xombination_study: No
select LTRIM (REGEXP_SUBSTR (ERROR_TEXT, '[^,]+', 1, 1), ',') AS part_1 FROM ERROR_LOG_TEMP_5;
with error_log_temp_5 as (
select q'['franchise': 'Px Oncology (Solid Tumors, all XA Onc projects)', 'zlinical_xombination_study': 'No', 'clinical_comparator_study': 'No]'
error_text from dual
)
select
rtrim(regexp_substr(error_text,'''.*'','),',')
from error_log_temp_5
/
with error_log_temp_5 as (
select replace(
q'['franchise': 'Px Oncology (Solid Tumors, all XA Onc projects)', 'zlinical_xombination_study': 'No', 'clinical_comparator_study': 'No]'
,''',',chr(254)
) error_text
from dual
)
select
trim(regexp_substr(error_text,'[^' || chr(254) || ']+', 1, column_value)) || ''''
from error_log_temp_5,
table(
select collect(level) from dual
connect by level <= length(error_text) - length(replace(error_text, chr(254))) + 1
)
/
ORA-12726: unmatched bracket in regular expression
12726. 00000 - "unmatched bracket in regular expression"
*Cause: The regular expression did not have balanced brackets.
*Action: Ensure the brackets are correctly balanced.
error_text
So, I guess the below code needs further update.with error_log_temp_5 as (
select replace(
q'['franchise': 'Px Oncology (Solid Tumors, all XA Onc projects)', 'zlinical_xombination_study': 'No', 'clinical_comparator_study': 'No]'
,''',',chr(254)
) error_text
from dual
)
select
trim(regexp_substr(error_text,'[^' || chr(1) || ']+', 1, column_value)) || ''''
from error_log_temp_5,
table(
select collect(level) from dual
connect by level <= length(error_text) - length(replace(error_text, chr(1))) + 1
)
/
key value
------------------ -----------------------------------------------
franchise Px Oncology (Solid Tumors, all MA Onc projects)
...
DBP-complexity (null)
...
approved_countries 'JPN'
...
with error_log_temp_5 as (
select replace(
q'['franchise': 'Px Oncology (Solid Tumors, all XA Onc projects)', 'zlinical_xombination_study': 'No', 'clinical_comparator_study': 'No]'
,''',',chr(254)
) error_text
from dual
)
select
trim(regexp_substr(error_text,'[^' || chr(254) || ']+', 1, 1)) || ''''
from error_log_temp_5
/
See if this works for you:
rtrim(regexp_substr(error_text,'''.*'','),',')