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

Teradata® VantageCloud Lake

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

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

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

Example Prerequisites

Create a temporary view:
>>> connection_object.execute("create view temporary_view as (select 1 as dummy_col1, 2 as dummy_col2);")

Example 1: Drop a view "temporary_view" from current database

>>> db_drop_view(view_name = 'temporary_view')
True

Example 2: Drop a view "temporary_view" from schema "alice"

>>> db_drop_view(view_name = 'temporary_view', schema_name = 'alice')
True