I am attempting to insert JSON data into a table. This is its schema.
CREATE OR REPLACE TABLE CHIPPER.UTILS.USER_CRR_VERIFICATION (
USER_ID VARCHAR(2048),
CRR_VERSION NUMBER(4, 2),
VERIFICATION_DETAILS VARIANT,
CREATED_AT TIMESTAMP_NTZ (9),
UPDATED_AT TIMESTAMP_NTZ (9)
);
This is the corresponding query in the retool dashboard:
INSERT INTO
UTILS.USER_CRR_VERIFICATION (VERIFICATION_DETAILS)
SELECT
parse_json('{"retool_id" : "{{ current_user.fullName}}" }')
;
The expected output in the VERIFICATION_DETAILS
column is:
"{
"retool_id": "Ranjan Srinivas"
}"
However, the output I get is:
"{
"retool_id": ":4"
}"
There seems to be an issue with how the
{{ current_user.fullName }}
is parsed. If a static value like "Ranjan" is passed, then the query works.
Any idea on why this might be happening?