@hal.littel
To store a JSON array in Oracle, you can use the JSON data type introduced in Oracle Database 21c. Here's how you can do it:
1 2 3 4 |
CREATE TABLE my_table ( id NUMBER, json_data JSON ); |
1
|
INSERT INTO my_table (id, json_data) VALUES (1, '[{"name": "John", "age": 30}, {"name": "Jane", "age": 25}]'); |
1
|
SELECT id, json_data FROM my_table; |
You can also use the JSON_OBJECT
function in Oracle to create JSON objects and arrays dynamically from SQL queries. This function allows you to construct complex JSON data structures within SQL statements.