Hello Community,
SQL language remains the most practical way to retrieve information stored in a database.
The JSON format is very often used in data exchange.
It is therefore common to seek to obtain data in JSON format from SQL queries.
Below you will find simple examples that can help you meet this need using ObjectScript and Python code.
ObjectScript : using Dynamic SQL with %SQL.Statement + JSON structures with %DynamicObject and %DynamicArray
ClassMethod getJSON() As%String
{
// declaration of an SQL queryset query = "SELECT top 3 name,age,to_char(dob,'Day DD Month YY
.png)


.png)
.png)
.png)
.png)