knek
knek

Reputation: 35

How can I update json value in oracle without APEX?

Can you help? How can I update json value in oracle without APEX ? For read I use json_table

Upvotes: 0

Views: 1571

Answers (2)

Akhilesh
Akhilesh

Reputation: 121

Seems there are useful PL/SQL functions introduced in 12.2. See the developer guide here.

If you are not on 12.2, there is a Java API here.

Upvotes: 1

Thomas
Thomas

Reputation: 203

Are you using simple update statements? If yes, then you can modify your content like this:

UPDATE tbl SET DOCUMENT_COLUMN = REPLACE(DOCUMENT_COLUMN, JSON_ELEMENT, NEW_VALUE);

Your column has to be a CLOB column and you need to define a constraint like this on your table to enforce JSON usage.

ALTER TABLE tbl CONSTRAINT tbl_json_chk CHECK (DOCUMENT_COLUMN IS JSON (STRICT))

Upvotes: 1

Related Questions