You can call the DeleteTable operation to delete a specified table from the current instance.

Note For more information about the DeleteTable operation, see DeleteTable.

Prerequisites

  • The OTSClient instance is initialized. For more information, see Initialization.
  • A table is created.
  • The index tables and search indexes for the table are deleted.

Operations

def delete_table(self, table_name):

Parameters

Parameter Description
table_name The name of the table.

Examples

The following code provides an example on how to delete a specified table:

try:
    # Call the operation to delete the table named SampleTable.
    ots_client.delete_table('SampleTable')
    # If the task succeeds, no exception is returned.
    print "delete table succeeded"
    # If the task fails, an exception is returned for you to handle.
except Exception:
    print "delete table failed"            

For the detailed sample code, visit DeleteTable@GitHub.