Fork me on GitHub

JsonWrite

Signature

JsonWrite(VARCHAR path, VARCHAR tableName);

Description

Writes table tableName to a JSON file located at path.

Examples

Write a spatial table and export it into a JSON file.

-- Initialize the spatial table
CREATE TABLE TEST(ID INT PRIMARY KEY, THE_GEOM POINT);
INSERT INTO TEST VALUES (1, 'POINT(0 1)');
-- Export
CALL JsonWrite('/home/user/test.json', 'TEST');

Open the test.json file.

{"ID":1,"THE_GEOM":"POINT (0 1)"}
See also