DROP SHARDING TABLE RULE

Description

The DROP SHARDING TABLE RULE syntax is used to drop sharding table rule for specified database.

Syntax

Grammar Railroad diagram

  1. DropShardingTableRule ::=
  2. 'DROP' 'SHARDING' 'TABLE' 'RULE' ifExists? shardingRuleName (',' shardingRuleName)* ('FROM' databaseName)?
  3. ifExists ::=
  4. 'IF' 'EXISTS'
  5. shardingRuleName ::=
  6. identifier
  7. databaseName ::=
  8. identifier

Supplement

  • When databaseName is not specified, the default is the currently used DATABASE. If DATABASE is not used, No database selected will be prompted;
  • ifExists clause is used to avoid Sharding rule not exists error.

Example

  • Drop mutiple sharding table rules for specified database
  1. DROP SHARDING TABLE RULE t_order, t_order_item FROM sharding_db;
  • Drop a sharding table rule for current database
  1. DROP SHARDING TABLE RULE t_order;
  • Drop sharding table rule with ifExists clause
  1. DROP SHARDING TABLE RULE IF EXISTS t_order;

Reserved word

DROP, SHARDING, TABLE, RULE, FROM