View source: R/src-snowflakedb.R
db_snowflake_copy | R Documentation |
Perform a COPY INTO in Snowflake to perform a load or unload operation.
db_snowflake_copy(con, from, to, format_opts = list())
con |
A SnowflakeDBConnection object. |
from |
The source of the data, i.e., what comes after the FROM in the COPY statement. This can be a table, a subquery, a stage, or a local file. |
to |
The target of the COPY statement as a string. This can be a S3/Azure/local filesystem location, a table, or a Snowflake stage. |
format_opts |
A list of key-value pairs for the Snowflake COPY file_format options. |
## Not run: # Connection basics --------------------------------------------------------- # To connect to a database first create a src: my_db <- src_snowflakedb(user = "snowman", password = "letitsnow", account = "acme", opts = list(warehouse = "mywh", db = "mydb", schema = "public") # Copy from a local CSV file to a target table in my_db. db_snowflake_copy(my_db$con, from = "file:///my/directory/foo.csv", to = "target_table", format_opts = list(format = 'csv', field_delimiter = ',')) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.