I am trying to send data in JSON format from a result set and it is not possible for me to do, I would appreciate any help on this.
here is an example from alphapedia. when I do, I get the same, not nicely arranged in separate lines, in a single line, that does not matter. there is no comma between the two neighboring objects and I don't see enveloping square brackets either. I can do this manually myself, but looking for easier way ( or lazy way)
I would like the following format
am I wrong in this? has anyone successfully transmitted a resultset across in JSON format and if so would be kind enough to help me out?
thank you in advance.
edit: the actual result comes with double quotes as required but not shown in the alphapedia example, I am more interested in array representation of the objects.
Code:
flag = cn.open("::Name::AlphasportsXbasic") cn.Execute("select firstname, lastname, bill_city from customer where bill_state_region = 'ca'") rs = cn.ResultSet ?rs.ToJSONObjectSyntax() {FIRSTNAME : 'Willy', LASTNAME : 'Winka', BILL_CITY : 'Los Angeles'} {FIRSTNAME : 'Yvonne', LASTNAME : 'Harrington', BILL_CITY : 'Los Angeles'} {FIRSTNAME : 'Joan', LASTNAME : 'McAndrews', BILL_CITY : 'Los Angeles'} {FIRSTNAME : 'Leonard', LASTNAME : 'Burtonski', BILL_CITY : 'Santa Clarita'} {FIRSTNAME : 'Peter', LASTNAME : 'Harrison', BILL_CITY : 'Los Angeles'} {FIRSTNAME : 'James', LASTNAME : 'Mahoney', BILL_CITY : 'Long Beach'}
I would like the following format
Code:
[COLOR="#FF0000"][[/COLOR] {FIRSTNAME : 'Willy', LASTNAME : 'Winka', BILL_CITY : 'Los Angeles'}[COLOR="#FF0000"],[/COLOR] {FIRSTNAME : 'Yvonne', LASTNAME : 'Harrington', BILL_CITY : 'Los Angeles'}[COLOR="#FF0000"],[/COLOR] {FIRSTNAME : 'Joan', LASTNAME : 'McAndrews', BILL_CITY : 'Los Angeles'}[COLOR="#FF0000"],[/COLOR] {FIRSTNAME : 'Leonard', LASTNAME : 'Burtonski', BILL_CITY : 'Santa Clarita'}[COLOR="#FF0000"][/COLOR][COLOR="#FF0000"],[/COLOR] {FIRSTNAME : 'Peter', LASTNAME : 'Harrison', BILL_CITY : 'Los Angeles'}[COLOR="#FF0000"][/COLOR][COLOR="#FF0000"],[/COLOR] {FIRSTNAME : 'James', LASTNAME : 'Mahoney', BILL_CITY : 'Long Beach'} [COLOR="#FF0000"]][/COLOR]
thank you in advance.
edit: the actual result comes with double quotes as required but not shown in the alphapedia example, I am more interested in array representation of the objects.
Comment