Got an error while inserting the json string into snowflake table

Viewed 294

Trying to insert data to snowflake table

insert into realtime_kpi_feature_list_map (kpi_id, feature_list_id, config) 
values (1, 10, parse_json('{"b":1,"a":2}'))

but get an error

SQL compilation error: Invalid expression [PARSE_JSON('{"b":1,"a":2}')] in VALUES clause

I tried with different json string but got the same error. What I do wrong?

1 Answers

This works in my Snowflake environment...

    insert into realtime_kpi_feature_list_map  (kpi_id, feature_list_id, config) 
    select 1, 10, parse_json($${
      "b":1, 
      "a":2
     }$$);
Related