## Explicitly Declaring Parameters to Insert Datainsert into table (key1, key2, value1, vlaue2) values (1, "abc", 2, "def") [after -1] [shift none/head/tail];## Importing a CSV File to Insert Datainsert into table infile result.csv [after -1] [shift none/head/tail];## Importing an XML File to Insert Data Provided that the TDR File Is Provided at the Client’s Startupinsert into table infile result.xml [after -1] [shift none/head/tail] using tdr;
Parameter | Protobuf and TDR | Required |
table | Table name | Yes |
key | Primary key field name | Yes |
value | Non-primary key field name | Yes, at least one |
after | LIST table: n>0 indicates that the data will be inserted after the first n data n=-2 indicates that the data will be inserted at the head of the queue n=-1 indicates that the data will be inserted at the tail of the queue n<-2: unsupported GENERIC table: this field is unsupported. | No |
shift | If the table size exceeds the maximum value, you can specify how to clear data automatically. Valid values: none : no data will be clearedhead : data at the head of the queue will be clearedtail: data at the tail of the queue will be cleared. | No |
using tdr | The Protobuf table does not support this parameter. To insert data into the TDR table, import an XML file whose structure must strictly comply with the XML syntax. In addition, a TDR file must be provided when the client is started. | No |
infile | Read data from the file | No |
tcaplus>insert into game_players (player_id,player_name,player_email,game_server_id) values (2,name,email,2);insert successinsert time: 45322 ustcaplus> Insert into table_list (uin, name, key1) values (99,99,99) after -1 shift tail;insert successinsert time: 22464 ustcaplus> Insert into table_list infile result.xml using tdr;insert successinsert time: 9493 ustcaplus> Insert into table_list infile result.csv;insert successinsert time: 22368 us
Was this page helpful?