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!

Delete JSON Element

Flamingo123-OracleAug 20 2018 — edited Aug 20 2018

I want to delete the second element in the JSON array I inserted into test_details column.

How do I do this using DELETE SQL syntax?

CREATE TABLE test_json (

     test_name      VARCHAR2(1000) not null primary key,

     test_details       clob

         CONSTRAINT test_valid_json CHECK (

             test_details IS JSON

         )

);

insert into test_json values('foo1',  '["a","b"]');

SELECT test_name, value FROM test_json, json_table(test_json.test_details , '$[*]'  COLUMNS (value PATH '$' ) );

Thanks,

Sandeep

This post has been answered by mathguy on Aug 20 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2018
Added on Aug 20 2018
10 comments
3,520 views