truncate_table: Generate a TRUNCATE TABLE statement, optionally execute the...

View source: R/sql_helpers.R

truncate_tableR Documentation

Generate a TRUNCATE TABLE statement, optionally execute the statement if con is not NULL.

Description

Generate a TRUNCATE TABLE statement, optionally execute the statement if con is not NULL.

Usage

truncate_table(args, con = NULL)

Arguments

args

A string, the arguments to add to the TRUNCATE TABLE statement.

con

A database connection that can be passed to DBI::dbSendQuery/DBI::dbGetQuery.

Value

A string, the TRUNCATE TABLE statement; or the results retrieved by DBI::dbGetQuery after executing the statement.

Examples

truncate_table(args = "table1")

sqlHelpers documentation built on Oct. 15, 2023, 1:07 a.m.