With the new JSON functions, does anyone know if you can sort the results?
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20i%20Technology%20Updates/page/JSON%20Publishing%20Functions
Here's an example query using an IBM sample table.  It seems to give the correct results, but I need to be able to sort them.
select json_arrayagg(
         json_object('CustNo' :CUSNUM,
                     'LastName' :LSTNAM,
                     'Initials' :INIT,
                     'Street' :STREET,
                     'City' :CITY,
                     'State' :STATE,
                     'Zip' :ZIPCOD,
                     'CreditLimit' :CDTLMT,
                     'ChargeCode' :CHGCOD,
                     'Balance' :BALDUE,
                     'Credit' :CDTDUE)
                    )
  from QIWS.QCUSTCDT
  where BALDUE > 0
As an Amazon Associate we earn from qualifying purchases.
	
 
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.