Description
This function builds a create table query to be used by db_save_query
to create the table.
Usage
## S3 method for class 'Teradata'
sql_query_save(
con,
sql,
name,
temporary = FALSE,
table.type = "PI",
primary.index = NULL,
...
)
Arguments
con |
Required Argument. |
sql |
Required Argument. |
name |
Required Argument. |
temporary |
Optional Argument. |
table.type |
Optional Argument. |
primary.index |
Optional Argument. |
... |
Other parameters passed to methods. |
Value
Returns the query of the table that is to be created.
See Also
db_compute()
, db_save_query()
Examples
# Get remote data source connection.
con <- td_get_context()$connection
# Save iris dataset into table 'sql_query_save_test'.
iris2 <- copy_to(con, iris, name = "sql_query_save_test", overwrite = FALSE)
sql_query <- "select * from sql_query_save_test"
# Get the SQL query for the PI table from the result set of "sql_query".
sql_query_save(con, sql_query, "db_save_query_test1", temporary = FALSE,
table.type = "PI",
primary.index = c("Petal.Length","Species"))