Description |
|
Syntax | JSON_SET( |
Output | text |
Variables
json
: The JSON object.json_path
: The path to the specific field in the JSON object.value
: The new value to set for the specified field.
Example
JSON_SET(`Company Details`, "$.date", TO_TEXT(TODAY()))
Company Details | JSON_SET |
{"company_id": 1, "company_name": "ABC Inc.", "revenue": 500000, "location": "New York"} | {"company_id": 1, "company_name": "ABC Inc.", "revenue": 500000, "location": "New York", "date": "2023-12-14"} |
{"company_id": 2, "company_name": "XYZ Corporation", "revenue": 750000, "location": "San Francisco"} | {"company_id": 2, "company_name": "XYZ Corporation", "revenue": 750000, "location": "San Francisco", "date": "2023-12-14"} |
{"company_id": 3, "company_name": "LMN Enterprises", "revenue": 300000, "location": "Chicago"} | {"company_id": 3, "company_name": "LMN Enterprises", "revenue": 300000, "location": "Chicago", "date": "2023-12-14"} |