# Modifying Snowflake data that is of Variant data type

**URL:** <https://community.cdata.com/t/modifying-snowflake-data-that-is-of-variant-data-type/490>\
**Category:** Data Sources\
**Tags:** article, snowflake\
**Created:** [October 25, 2023, 6:58pm UTC](https://community.cdata.com/t/modifying-snowflake-data-that-is-of-variant-data-type/490 "2023-10-25T18:58:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lance\_R](https://avatars.discourse-cdn.com/v4/letter/l/e95f7d/32.png) [@Lance\_R](https://community.cdata.com/u/Lance_R)\
**Post date:** [October 25, 2023, 6:58pm UTC](https://community.cdata.com/t/modifying-snowflake-data-that-is-of-variant-data-type/490/1 "2023-10-25T18:58:36Z")

</div>

Snowflake’s variant data type columns can accept a variety of data types, but these columns require some additional considerations when attempting to modify their data. The two primary considerations are that you may need to use a “SELECT” clause instead of a “Values” clause, and you will need to use one of a couple methods of casting the data into a variant type. See the following examples for clarification. In each of the examples below, we are inserting a new record with two columns, ID and a variant data type column value (I.e., “VARIANT1”):

We can use “TO\_VARIANT” to insert a float value into the variant column:

INSERT INTO VARIANTTABLE (ID, VARIANT1) SELECT 1, TO\_VARIANT(5.0)

We can use “PARSE\_JSON” to insert JSON structures into the variant column:

INSERT INTO VARIANTTABLE (ID, VARIANT1) SELECT 1, PARSE\_JSON(‘{“test”: “Testing”, “url”:“[www.website.com](http://www.website.com)”}’)

For both query examples above, you must use the “SELECT” clause instead of the “VALUES” clause – using the “VALUES” clause in this situation will cause a SQL compilation error.

For more details on how Variant data types operate and should be handled, see the Snowflake documentation here: [https://docs.snowflake.com/en/sql-reference/data-types-semistructured#examples](https://docs.snowflake.com/en/sql-reference/data-types-semistructured#examples)
