How to return hierarchical JSON from a query in ISG SOA Suite
Is it possible generate a hierarchical JSON output in ISG? For example (employees within departments):
{ "departments":[ { "department":{ "department_name":"DEV", "department_no":70, "employees":[ { "employee_number":9000, "employee_name":"JONES", "salary":1000 }, { "employee_number":9001, "employee_name":"SMITH", "salary":2000 } ] } },
I can write a SQL query like this:
select a.invoice_id, invoice_num, cursor(select line_number, description from ap_invoice_lines_all l where l.invoice_id=a.invoice_id) lines from ap_invoices_all a where invoice_id=145054;
But how do I actually put that into ISG so that I get the hierarchical JSON produced. It needs to go into a package somehow and I cannot figure that part out.