SQL Anywhere 188.8.131.525
We are developing a JSON payload to be passed via a web service to an IOS application. It is simple enough to use the FOR JSON AUTO clause and I have obtained a variety of JSON selects. But our iPad developers have asked for a combined payload that would concatenate several selects into a single long varchar.
How to accomplish that escapes me.
asked 14 Sep '16, 17:04
Thanks for the ideas, looks like I will just "string" the data together. (Glad JSON is rather simple in that regard.)
The basic SELECT... FOR JSON is so easy, I was hoping for one more silver bullet: - SELECT * FROM A FOR JSON INTO ls_jsona; - SELECT * FROM B FOR JSON INTO ls_jsonb; - SELECT ls_jsona || ls_jsonb; OR: - SELECT * FROM A FOR JSON UNION ALL SELECT * FROM B FOR JSON;
Guess I'll have to actually do some work :-).
answered 15 Sep '16, 10:36
If you have create for example two JSON Strings in two variables.
You can combine these two JSON Objects in an array.
So instead of having different web service calls for different select statements you concatenate them in one variable and return the combine result as payload.
answered 15 Sep '16, 02:22