db_drop_table() | Database Utilities | Teradata Python Package - db_drop_table() - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-02-17
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Use the db_drop_table() function to drop a table from a given schema. Returns True if the operation is successful.

Required arguments:
  • table_name specifies the table name to be dropped.
Optional arguments:
  • schema_name specifies the database of the table to be dropped. If a database is not specified, the function drops table from the current database.

Example Prerequisites

  • Import the teradataml module:
    >>> from teradataml import *
  • Load example data:
    >>> load_example_data("dataframe", "admissions_train")

Example 1: Drop table "admissions_train" from current database

>>> db_drop_table(table_name = "admissions_train")
True

Example 2: Drop table "admissions_train" from schema "alice"

>>> db_drop_table(table_name = "admissions_train", schema_name = "alice")
True