Working with JSON documents by using SQL

You can store and retrieve JSON data directly by using SQL with several built-in and user-defined functions that are supplied with Db2 for z/OS. Start of changeThis method is the recommended approach for working with JSON documents in Db2 for z/OS.End of change

The JSON functions rely on the JSON documents being stored in Db2 for z/OS an internal binary format named BSON (Binary JSON).

You can also store and retrieve JSON values in Db2 columns without parsing or indexing on specific fields inside the JSON document, by using CLOB or VARCHAR column to hold the value. You can then query and update based on another key column in the table.