Delete a mapping table
Tablestore SDK for Python deletes one or more mapping tables without affecting the corresponding data tables, search indexes, or data.
Prerequisites
Install Tablestore SDK for Python and initialize a client.
SQL query requires version 5.4.2 or later. We recommend that you use the latest version.
Description
Call the exe_sql_query method to execute a DROP MAPPING TABLE statement and delete one or more mapping tables. Deleting a mapping table does not delete the corresponding data table, search index, or stored data.
def exe_sql_query(self, query)
The following example deletes the example_table mapping table.
query = "DROP MAPPING TABLE example_table"
client.exe_sql_query(query)
Parameters
The exe_sql_query method contains the following parameter.
|
Name |
Type |
Description |
|
query (required) |
String |
The |
Scenario examples
Delete multiple mapping tables
Separate multiple mapping table names with commas in one statement.
query = "DROP MAPPING TABLE mapping_table_a, mapping_table_b"
client.exe_sql_query(query)