Step 6: Update Data

TcaplusDB Client - Update Command

For TcaplusDB Client Instructions, see Document.

1. Function Descriptions

This command is used to update a record to a table. It can be operated in two ways: show declaration parameters or pass in a file.

The -index field value must be provided for the list table, or the update fails.

If the specified data does not exist, an error will be reported.

2. Initial Version

3.40.0

3. Command Syntax

## Display the value of the declaration parameter and update the corresponding data
update table set value1 = 1, value2 = "abc", value3 = 0x123456 where key1 = 1 and key2 = "abc" and [-index = 1];

## Support auto-increase of field values, such as
update table set value1 = value1 + 1, value2 = value2 + 2 where key1 = 1 and key2 = "abc";

Parameter description:

ParameterPB TableTDR TableRequired
tableTable nameTable nameYes
keyKey field name. You can specify the value of partial key fieldsKey field name. You can specify the value of partial key fieldsYes
valueNon-primary key field nameNon-primary key field nameAt least one or *
-indexGeneric table: not supported.
List table: '-index' must be specified. It only modifies the data at the specified position in a list
Generic table: not supported.
List table: '-index' must be specified. It only modifies the data at the specified position in a list
Yes
using tdrDo not supportIf using this parameter, you need to specify the TDR file corresponding to the target table through the startup parameter when starting the TcaplusDB client.
When using this parameter, if the imported data file is in XML format, the file structure should strictly meet the XML syntax requirements
No

In addition to specifying the primary keys in the where statement, versions after 3.55.0 also support the use of AND, combined with more flexible filter conditions. See Detailed Syntax.

4. Command Example

See Table Definition Example for table definition.

tcaplus> update table_list set level=99 and count= 88 where uin=99 and name = "99" and key1=99 and -index=0;

update success

update time: 117086 us

5. Common Errors

Refer to Common Errors.

[[TDR Generic Table] [C++ SDK] Interface Description for Updating a Record](../../../05TcaplusDB_SDK_and_API/01TDR_Table_SDK_and_API/01C++_SDK/02Interface_Documents/03[Generic_Table]Update_a_Record.md

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

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

[[TDR List Table][C++ SDK] Interface Description for Replacing a Record](../../../05TcaplusDB_SDK_and_API/01TDR_Table_SDK_and_API/01C++_SDK/02Interface_Documents/19[List_Table]Replace_an_Element_to_a_Specified_Position_in_a_List.md

[[TDR List Table][Go SDK] Interface Description for Updating a Record](../../../05TcaplusDB_SDK_and_API/01TDR_Table_SDK_and_API/03Go_SDK/02Interface_Documents/19[List_Table]Replace_an_Element_to_a_Specified_Position_in_a_list.md

[[PB Generic Table] [C++ SDK] Interface Description for Updating a Record](../../../05TcaplusDB_SDK_and_API/02PB_Table_SDK_and_API/01C++_SDK/02Interface_Documents/03[Generic_Table]Update_a_Record.md

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

[PB Generic Table] [RESTFul API] Interface Description for Updating a Record

[[PB List Table][C++ SDK] Interface Description for Replacing a Record](../../../05TcaplusDB_SDK_and_API/02PB_Table_SDK_and_API/01C++_SDK/02Interface_Documents/20[List_Table]Replace_an_Element_to_a_Specified_Position_in_a_List.md

[[PB List Table][Go SDK] Interface Description for Replacing a Record](../../../05TcaplusDB_SDK_and_API/02PB_Table_SDK_and_API/02Go_SDK/02Interface_Documents/21[List_Table]Replace_an_Element_to_a_Specified_Position_in_a_List.md

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