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

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Package for Python
Release Number
20.00
Published
March 2025
ft:locale
en-US
ft:lastEdition
2025-12-05
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

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

Required Argument

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.
suppress_error
Specifies whether to raise an error or not.

Default value is False.

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