Quantcast
Channel: SCN : Popular Discussions - SAP SQL Anywhere
Viewing all articles
Browse latest Browse all 1302

SQL Anywhere 16.0.0.1915 json result

$
0
0

If I execute the following query in I-SQL


SELECT top 2 Identifier id, Description Text

FROM Tax

order by id for json raw

 

I get the following result:

 

[{"id":1,"Text":"AEU Domestic delivery GB"},{"id":2,"Text":"AEU Domestic delivery BE"}]

 

That's what I expect.

 

However if I use this query as a subquery in another query:

 

SELECT

(SELECT top 2 Identifier id, Description Text

FROM Tax

order by id for json raw) as result,

(if (select count() from Tax) > 2 then 'True' else 'False' endif) as more

for json raw

 

I get the following result:

 

[{"result":"[{\"id\":1,\"Text\":\"AEU Domestic delivery GB\"},{\"id\":2,\"Text\":\"AEU Domestic delivery BE\"}]","more":"True"}]

 

How do I get rid of these '\'. I wasn't expecting them.

 

Regards,

 

Frank


Viewing all articles
Browse latest Browse all 1302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>