We can generate Json data on ibm i using JSON_OBJECT sql function.

Example:

If we have a Empmst table with the following record. Emp_ID is numeric, First_Name and Last_Name fields are CHAR.

Emp_ID  First_Name    Last_Name

1                 Nanda              Jay

 

Select Json_Object (‘EmpId’  value Emp_ID, ‘Name’ value  First_Name)

from EmpMast

Result :

{ “EmpId” : 1, “Name” : Nanda}