Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to read the values in the string using regular expression

user9113644Nov 17 2014 — edited Nov 19 2014

HI

  My database is 11.2..0.2.0. I  have the below JSON String.  I would like to extract the values against the attributes in the string:

[{“FirstName” : “abc”,”Lastname” : “xyz” ,”Mpi” :10002},{“FirstName” : “cbd”,”Lastname” : “adc” ,”Mpi” :10003}]

I am using the below query for reading the independent values to start with, But no luck:

SELECT

TRIM('?'  FROM

REGEXP_SUBSTR(

'[{“FirstName” : “abc”,”Lastname” : “xyz” ,”Mpi” :10002},{“FirstName” : “cbd”,”Lastname” : “adc” ,”Mpi” :10003}]',

'[^[{":",]+',1,4)

)

FROM DUAL;

Please help me in this.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2014
Added on Nov 17 2014
6 comments
2,898 views