SQLite JSON_OBJECT() Function
Definition and Usage
The JSON_OBJECT() function creates a JSON object. The arguments are pairs of a name and a value.
Note: Read more about JSON in the SQLite JSON chapter.
Tip: Also look at JSON_ARRAY().
Syntax
JSON_OBJECT(name1, value1, name2, value2, ...)
Parameter Values
| Parameter | Description |
|---|---|
| name1, value1, ... | Optional. Pairs of names and values |
Technical Details
| Return type: | Text |
|---|
More Examples
Example
Create a JSON object for each shipper:
SELECT JSON_OBJECT('id', ShipperID,
'name', ShipperName)
FROM Shippers;
Try it Yourself »