select
x[2],
x[3],
x[4],
x[5],
x[6],
x[7],
x[8],
x[9]
from (
select
regexp_split_to_array(
'BeneficaryCurrency=IDR;ExchangeRate=1.000000000;CreditAccountNumber=02105117893;DebitCurrency=IDR;DebitAccountNumber=02105168722;Amount=25289410;ETACReferenceNo=20100701000031;PaymentCurrency=IDR;',
E'(;*\\w+=|;+)')
as x ) t
(or)
select
split_part(x , '|',1),
split_part(x , '|',2),
split_part(x , '|',3),
split_part(x , '|',4),
split_part(x , '|',5),
split_part(x , '|',6),
split_part(x , '|',7),
split_part(x , '|',8)
from (
select
regexp_replace(
'BeneficaryCurrency=IDR;ExchangeRate=1.000000000;CreditAccountNumber=02105117893;DebitCurrency=IDR;DebitAccountNumber=02105168722;Amount=25289410;ETACReferenceNo=20100701000031;PaymentCurrency=IDR;',
'(\\w+)=([\.|\\w+]+)(\;)',
E'\\2|',
'g')
as x ) t
No comments:
Post a Comment