SQL Anywhere allows you to execute a SQL query against your database and return the results as a JSON document by using the FOR JSON clause in a SELECT statement.
The FOR JSON clause can be used in any SELECT statement, including subqueries, queries with a GROUP BY clause or aggregate functions, and view definitions. Using the FOR JSON clause represents relational data as a JSON array composed of arrays, objects, and scalar elements.
Within the FOR JSON clause, you can specify one of the following JSON modes that control the format of the JSON that is generated:
RAW returns query results as a flattened JSON representation. Although this mode is more verbose, it can be easier to parse.
AUTO returns query results as nested JSON objects, based on query joins.
EXPLICIT allows you to specify how column data is represented. You can specify columns as simple values, objects, or nested objects to produce uniform or heterogeneous arrays.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0|