Wednesday, October 25, 2017

Oracle 11g - REGEXP_SUBSTR extract comma delimiter string to fields

select REGEXP_SUBSTR('CHIDAM,,20-Feb-17,1-Feb-19', '([^,]*)(,|$)', 1, 1,NULL,1) f1,
REGEXP_SUBSTR('CHIDAM,,20-Feb-17,1-Feb-19', '([^,]*)(,|$)', 1, 2,NULL,1) f2,
REGEXP_SUBSTR('CHIDAM,,20-Feb-17,1-Feb-19', '([^,]*)(,|$)', 1, 3,NULL,1) f3,
REGEXP_SUBSTR('CHIDAM,,20-Feb-17,1-Feb-19', '([^,]*)(,|$)', 1, 4,NULL,1) f4

from dual

Output

F1
F2
F3
F4
CHIDAM

20-Feb-17
1-Feb-19

No comments:

Post a Comment

Oracle EBS R12 – Query to View Consolidated Invoice Details with Individual Transactions

SELECT     hp.party_name                  AS customer_name,     aca.account_number             AS customer_account,     hci.cons_billing_num...