To upload a file to the Snowflake stage, you can perform one of the following steps:
•Using the Snowflake Web UI.
1Open the stage where you want to upload a file.
2Click Files > Browse and select the file from your local machine.
3Click Upload.
•Using the PUT command at the command prompt.
To upload a document to the stage, you must use the following query in the terminal window:
snowsql -a <your accountIdentifier> -u <username> -d<database> -s <schema>
Enter the password. After that use the following PUT command to add the file to the Snowflake stage:
PUT 'file:path' @stage AUTO_COMPRESS = FALSE;
Note: Ensure that you use AUTO_COMPRESS = FALSE. Otherwise, the file will be compressed.
The file appears in the Stage Files tab of the Snowflake stage.
After uploading the file, you must get the stage path to invoke the process.
To get the stage path, perform the following steps:
1In the Snowflake Web UI, go to Data > Databases and select the database.
2In the Schemas tab, select the schema.
3In the Stages tab, select the stage where you have uploaded the file.
4Click the Actions menu corresponding to the file and click Copy path as shown in the following sample image:
In this image, DEMO is the database, LOCATION is the schema, and INPUT_STAGE is the stage.
When you copy the path as shown in the above sample image, you will get the path as '@"DEMO"."LOCATION"."INPUT_STAGE"/collation.pdf', where stage path is @DEMO.LOCATION.input_stage and the file name is collation.pdf. You'll need these values while invoking the process.