Creating JSON array with SQL Simon Hutchinson

​Last week I showed how I could retrieve information from a JSON array using SQL. This week I thought it would be a good thing to do the opposite: create a JSON array and insert it into a column in a SQL table.
To accomplish this I will be using several Db2 for i Table functions:

JSON_ARRAY:  Creates a JSON array
JSON_ARRAYAGG:  Creates a JSON array with an array element from each result row returned from a SQL statement
JSON_OBJECT:  Create a JSON object (not a physical object like a file)

Creating the most basic JSON array is very simple. I just need to use the JSON_ARRAY table function and pass values to it:
Read more » Read More 

Verified by MonsterInsights