This article shows how to write an XML file as a value into a Variant type column of a Snowflake table. An example of the Job is available in the sample job.zip file attached in this KB.
Create a table with a Variant type column in the Snowflake database using the following command:
CREATE TABLE TEST1006
(COL_HEADER VARIANT);
In Studio, use the PreparedStatement feature of the tSnowflakeRow component to read the input data as a String, and write it to the Snowflake Variant type column.
Configure the tFileInputDelimited component to read the XML file.
The tFileInputDelimited schema looks like this:
Configure the tSnowflakeRow component to load the data into the Snowflake table.
Enter the following command in the Query text box:
"INSERT INTO TEST1006 SELECT PARSE_XML(?);"
Under Advanced settings, select the Use PreparedStatement check box. Input values for the Parameter Index, Parameter Type, and Parameter Value.