TcaplusDB Client - Delete Command

For TcaplusDB Client Instructions, see Document.

1. Function Descriptions

Delete a record form the table according to the specified Key. If -index is not specified, all records that meet the condition will be deleted.

2. Initial Version

3.40.0

3. Command Syntax

delete from table where key1 = 1 and key2 = "abc" [and -index = 1] [by partkey];

Parameter description:

Parameter PB Table TDR Table Required
table Table name Table name Yes
key Primary key field name. If the by partkeyparameter is not specified, the values of all primary key fields must be filled in Primary key field name. If the by partkeyparameter is not specified, the values of all primary key fields must be filled in Yes
-index Generic table: Not supported.
List table: If "-index" is specified, only the specified record will be deleted; If "-index" is not specified, all records that meet the condition will be deleted
Generic table: Not supported.
List table: If "-index" is specified, only the specified record will be deleted; If "-index" is not specified, all records that meet the condition will be deleted
Yes
by partkey Generic table: After using this parameter, you can only specify the values of partial primary key fields in the WHERE condition, and all records that meet the criteria will be deleted. Note: It is not allowed to specify the values of several primary key fields at will. Local indexes must be created on these primary key fields.
List table: Do not support
Generic table: After using this parameter, you can only specify the values of partial primary key fields in the WHERE condition, and all records that meet the criteria will be deleted. Note: It is not allowed to specify the values of several primary key fields at will. Local indexes must be created on these primary key fields.
List table: Do not support
No

In addition to specifying the primary key in the where statement, the version after 3.55.0 also supports the use of AND, combined with more flexible filtering conditions. Only when the conditions are met can the deletion be performed. See the Detailed Syntax, where delete by partkey does not support conditional filtering.

It particularly supports batch deletion of multiple records in the List table, such as delete from table where key1 = 1 and key2 = "abc" and -index in (1, 2, 3).

4. Command Example

See Table Definition Example for table definition.

tcaplus> delete from table_list where  uin=99 and name = "99" and key1=99 and -index=0;


delete success

delete time: 10263 us

tcaplus> delete from table_generic_xiahuaxian  where _uin=99 and name = "danmi_test_1" and _key3=4 by partkey;

delete success

delete time: 14405 us

5. Common Errors

Refer to Common Errors.

[TDR Generic Table] [C++ SDK] Interface Description for Deleting a Record.

[TDR Generic Table] [Java SDK] Interface Description for Deleting a Record.

[TDR Generic Table] [Go SDK] Interface Description for Deleting a Record.

[TDR List Table][C++ SDK] Interface Description for Deleting a Record.

[TDR List Table][Java SDK] Interface Description for Deleting a Record.

[TDR List Table][Go SDK] Interface Description for Deleting a Record.

[PB Generic Table] [C++ SDK] Interface Description for Deleting a Record.

[PB Generic Table] [Go SDK] Interface Description for Deleting a Record.

[TDR Generic Table][RESTFul API] Interface Description for Deleting a Record.

[PB List Table][C++ SDK] Interface Description for Deleting a Record.

[PB List Table][Go SDK] Interface Description for Deleting a Record.

[PB List Table][RESTFul API] Interface Description for Deleting a Record.

[[PB List Table][RESTFul API] Interface Description for Deleting a Record](../../../05TcaplusDB_SDK_and_API/02PB_Table_SDK_and_API/03RESTFul_API/02Interface_Documents/27[List_Table]Delete_an_Element_from_a_List.md.

results matching ""

    No results matching ""