0

I'm having below value in the column "c1" (which is of datatype clob) on table "t1" in oracle (version 19c )

Data

[{"ID":"1","DUPID":"1"},{"ID":"2","DUPID":"2"},{"ID":"3","DUPID":"3"},{"ID":"4","DUPID":"4"},{"ID":"5","DUPID":"5"},{"ID":"6","DUPID":"6"},{"ID":"7","DUPID":"7"}]

I would like to get the count of the array. I've queried like below. But would like to know if there is a better way to achieve this.

Query used:

select regexp_count ( c1,'},{' ) +1 from t1 ;

1 Answer 1

3
select 
    JSON_value('[0,1,2,3,4]', '$.size()')
from dual ;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.