JSON_FORMAT
All functions > JSON > JSON_FORMAT
Returns the given JSON expression as a string.
Syntax
JSON_FORMAT(expr)
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
expr | JSON | Yes | The JSON expression to convert to string |
Returns
A VARCHAR representation of the JSON value
Notes
- Converts JSON values to their string representation
- Preserves JSON structure in the string output
- Objects are formatted as JSON object strings
- Arrays are formatted as JSON array strings
- Primitives are converted to their string representation
- Useful for storing or transmitting JSON as text
- Inverse of JSON_PARSE
- Output is valid JSON format