All Products
Search
Document Center

Tablestore:Delete a mapping table

Last Updated:Apr 28, 2025

You can use the DROP MAPPING TABLE statement to delete a mapping table. You can delete multiple mapping tables at the same time.

Usage notes

Before you use the SQL query feature, we recommend that you install the latest version of Tablestore SDK for Go.

Prerequisites

A client is initialized. For more information, see Initialize a Tablestore client.

Method

func (client *TableStoreClient) SQLQuery(req *SQLQueryRequest) (*SQLQueryResponse, error)

Parameters

req (required): the SQL statement to execute.

Sample code

The following sample code provides an example on how to execute the DROP MAPPING TABLE statement to delete a mapping table named test_table:

func dropMappingTable(client *tablestore.TableStoreClient) {
    // Create an SQL request. To delete multiple mapping tables, separate the mapping tables with commas (,).
    request := &tablestore.SQLQueryRequest{Query: "drop mapping table test_table"}
    // Execute the SQL request.
    response, err := client.SQLQuery(request)
}