Teradata R Package Function Reference | 17.00 - 17.00 - td_remove_file - Teradata R Package

Teradata® R Package Function Reference

prodname
Teradata R Package
vrm_release
17.00
created_date
September 2020
category
Programming Reference
featnum
B700-4007-090K

Description

This function removes external language script or model file from Vantage. On success, it prints a message that the file is removed.

Usage

td_remove_file(file.identifier = NULL, force.remove = FALSE)

Arguments

file.identifier

Required Argument.
Specifies the name associated with the user-installed file.
It cannot have a schema name associated with it, as the file is always installed in the current schema.
The name should be unique within the schema. It can be any valid Teradata identifier.
Types: character

force.remove

Optional Argument.
Specifies whether the file is to be removed even if it is being executed.
If set to TRUE, the file is removed even if it is being executed.
If set to FALSE, an error is raised if it is being executed.
Default Value: FALSE
Types: logical

Value

None. Prints message if the operation is successful.

See Also

td_install_file

Examples

# Note:
#  1. Connection must be established before running these examples.
#  2. File can be on client or remote database server.
#  3. Files mentioned in the examples are part of the package and can be found at
#     package install location as shown in the below examples.

# Replace "<tdplyr_install_location>" with the absolute path of the install location of the
# tdplyr library. One can get this location using '.libPaths()'.
# Make sure to include 'tdplyr' in the path. For example, <r_pkg_install_location>/tdplyr.

tdplyr_install_location <- "<tdplyr_install_location>"

# Example 1: Remove text file.

# Run the following before removing file.
td_install_file(file.identifier = 'mapper1',
                file.path.loc = file.path(tdplyr_install_location, "scripts", "mapper.R"))

# Remove the file 'mapper1'.
td_remove_file(file.identifier='mapper1', force.remove = TRUE)

# Example 2: Remove binary file.

# Run the following before removing file.
td_install_file(file.identifier='binaryfile1',
                file.path.loc = file.path(tdplyr_install_location, "scripts",
                                          "binary_file_replace.dms"),
                file.on.client = TRUE,
                is.binary = TRUE)

# Remove the file 'binaryfile1'.
td_remove_file(file.identifier = 'binaryfile1', force.remove = TRUE)