remove_file() | Database Utilities | Teradata Python Package - remove_file() - Teradata Package for Python

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.00
Published
November 2021
Language
English (United States)
Last Update
2022-01-14
dita:mapPath
bol1585763678431.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage

Use the remove_file() function to remove user installed files and scripts from Vantage.

Required arguments:
  • file_identifier specifies the name associated with the user installed file. It cannot have a database name associated with it, as the file is always installed in the current database.
  • force_remove specifies if system should check for the file being used before removing it.
    • If set to True, then the file is removed even if it is being executed.
    • If set to False, which is the default value, then an error is thrown if it is being executed.

Example 1: Remove an installed file using default text mode

  • See "Example: Install a file using default text mode" in install_file() to install the ''mapper.py" file.
  • Remove the installed "mapper.py" file:
    >>> remove_file (file_identifier='mapper', force_remove=True)
    File mapper removed from Vantage
    

Example 2: Remove a binary file

  • See "Example: Install a file using binary mode" in install_file() to install the ''binary_file.dms" file.
  • Remove the installed ''binary_file.dms" file:
    >>> remove_file (file_identifier='binaryfile', force_remove=False)
    File binaryfile removed from Vantage