This is an automated email from the ASF dual-hosted git repository.
critas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git
The following commit(s) were added to refs/heads/main by this push:
new c3f307af fix table insert rules (#850)
c3f307af is described below
commit c3f307afb94ce44940a61fa79afffde07b96a3fe
Author: leto-b <[email protected]>
AuthorDate: Thu Aug 28 17:05:00 2025 +0800
fix table insert rules (#850)
* fix table insert rules
* fix table insert rules
---
src/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md | 5 +++--
.../Master/Table/SQL-Manual/SQL-Data-Addition-Deletion.md | 4 ++--
src/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md | 5 +++--
.../latest-Table/SQL-Manual/SQL-Data-Addition-Deletion.md | 4 ++--
src/zh/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md | 5 +++--
.../Master/Table/SQL-Manual/SQL-Data-Addition-Deletion.md | 4 ++--
src/zh/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md | 7 ++++---
.../latest-Table/SQL-Manual/SQL-Data-Addition-Deletion.md | 4 ++--
8 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/src/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md
b/src/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md
index aed22ac2..369129a9 100644
--- a/src/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md
+++ b/src/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md
@@ -39,6 +39,7 @@ INSERT INTO <TABLE_NAME> [(COLUMN_NAME[, COLUMN_NAME]*)]?
VALUES (COLUMN_VALUE[,
4. If a column value does not exist for the identified device, the insertion
will overwrite any existing `null` values with the new data.
5. If a column value already exists for the identified device, a new insertion
will update the column with the new value.
6. Writing duplicate timestamps will update the values in the columns
corresponding to the original timestamps.
+7. When an INSERT statement does not specify column names (e.g., INSERT INTO
table VALUES (...)), the values in VALUES must strictly follow the physical
order of columns in the table (this order can be checked via the DESC table
command).
Since attributes generally do not change over time, it is recommended to
update attribute values using the `UPDATE` statement described below,Please
refer to the following [Data Update](#2-data-updates).
@@ -164,8 +165,8 @@ IoTDB supports inserting multiple rows of data in a single
statement to improve
```SQL
insert into table1
values
-('Frankfurt', '3001', '3', '1', '10', 4, 90.0, 1200.0)
-('Frankfurt', '3001', '3', '1', '10', 5, 90.0, 1200.0)
+(4, 'Frankfurt', '3001', '3', '1', '10', 90.0, 1200.0)
+(5, 'Frankfurt', '3001', '3', '1', '10', 90.0, 1200.0)
insert into table1
diff --git
a/src/UserGuide/Master/Table/SQL-Manual/SQL-Data-Addition-Deletion.md
b/src/UserGuide/Master/Table/SQL-Manual/SQL-Data-Addition-Deletion.md
index d4b5b398..475eafd5 100644
--- a/src/UserGuide/Master/Table/SQL-Manual/SQL-Data-Addition-Deletion.md
+++ b/src/UserGuide/Master/Table/SQL-Manual/SQL-Data-Addition-Deletion.md
@@ -56,8 +56,8 @@ VALUES ('Hunan', '3001', '3', NULL, NULL, 5, 90.0, NULL);
```SQL
INSERT INTO table1 VALUES
-('Beijing', '3001', '3', '1', '10', 4, 90.0, 1200.0),
-('Beijing', '3001', '3', '1', '10', 5, 90.0, 1200.0);
+(4, 'Beijing', '3001', '3', '1', '10', 90.0, 1200.0),
+(5, 'Beijing', '3001', '3', '1', '10', 90.0, 1200.0);
INSERT INTO table1("Region", "PlantID", "DeviceID", Time, "Temperature",
"Displacement")
VALUES
diff --git a/src/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md
b/src/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md
index aed22ac2..369129a9 100644
--- a/src/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md
+++ b/src/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md
@@ -39,6 +39,7 @@ INSERT INTO <TABLE_NAME> [(COLUMN_NAME[, COLUMN_NAME]*)]?
VALUES (COLUMN_VALUE[,
4. If a column value does not exist for the identified device, the insertion
will overwrite any existing `null` values with the new data.
5. If a column value already exists for the identified device, a new insertion
will update the column with the new value.
6. Writing duplicate timestamps will update the values in the columns
corresponding to the original timestamps.
+7. When an INSERT statement does not specify column names (e.g., INSERT INTO
table VALUES (...)), the values in VALUES must strictly follow the physical
order of columns in the table (this order can be checked via the DESC table
command).
Since attributes generally do not change over time, it is recommended to
update attribute values using the `UPDATE` statement described below,Please
refer to the following [Data Update](#2-data-updates).
@@ -164,8 +165,8 @@ IoTDB supports inserting multiple rows of data in a single
statement to improve
```SQL
insert into table1
values
-('Frankfurt', '3001', '3', '1', '10', 4, 90.0, 1200.0)
-('Frankfurt', '3001', '3', '1', '10', 5, 90.0, 1200.0)
+(4, 'Frankfurt', '3001', '3', '1', '10', 90.0, 1200.0)
+(5, 'Frankfurt', '3001', '3', '1', '10', 90.0, 1200.0)
insert into table1
diff --git
a/src/UserGuide/latest-Table/SQL-Manual/SQL-Data-Addition-Deletion.md
b/src/UserGuide/latest-Table/SQL-Manual/SQL-Data-Addition-Deletion.md
index d4b5b398..475eafd5 100644
--- a/src/UserGuide/latest-Table/SQL-Manual/SQL-Data-Addition-Deletion.md
+++ b/src/UserGuide/latest-Table/SQL-Manual/SQL-Data-Addition-Deletion.md
@@ -56,8 +56,8 @@ VALUES ('Hunan', '3001', '3', NULL, NULL, 5, 90.0, NULL);
```SQL
INSERT INTO table1 VALUES
-('Beijing', '3001', '3', '1', '10', 4, 90.0, 1200.0),
-('Beijing', '3001', '3', '1', '10', 5, 90.0, 1200.0);
+(4, 'Beijing', '3001', '3', '1', '10', 90.0, 1200.0),
+(5, 'Beijing', '3001', '3', '1', '10', 90.0, 1200.0);
INSERT INTO table1("Region", "PlantID", "DeviceID", Time, "Temperature",
"Displacement")
VALUES
diff --git a/src/zh/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md
b/src/zh/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md
index ee7a9e8a..ab21ec12 100644
--- a/src/zh/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md
+++ b/src/zh/UserGuide/Master/Table/Basic-Concept/Write-Updata-Data.md
@@ -39,6 +39,7 @@ INSERT INTO <TABLE_NAME> [(COLUMN_NAME[, COLUMN_NAME]*)]?
VALUES (COLUMN_VALUE[,
4. 若当前设备(由标识信息定位)不存在该属性列的值,执行写入操作将导致原有的空值(NULL)被写入的数据所替代。
5. 若当前设备(由标识信息定位)已有属性列的值,再次写入相同的属性列时,系统将更新该属性列的值为新数据。
6. 写入重复时间戳,原时间戳对应列的值会更新。
+7. 若 INSERT 语句未指定列名(如 INSERT INTO table VALUES (...)),则
VALUES中的值必须严格按表中列的物理顺序排列(顺序可通过 DESC table命令查看)。
由于属性一般并不随时间的变化而变化,因此推荐以 update 的方式单独更新属性值,参见下文 [数据更新](#数据更新)。
@@ -162,8 +163,8 @@ insert into table1("地区", "厂号", "设备号", "型号", "维修周期", Ti
```SQL
insert into table1
values
-('北京', '3001', '3', '1', '10', 4, 90.0, 1200.0),
-('北京', '3001', '3', '1', '10', 5, 90.0, 1200.0);
+(4, '北京', '3001', '3', '1', '10', 90.0, 1200.0),
+(5, '北京', '3001', '3', '1', '10', 90.0, 1200.0);
insert into table1
diff --git
a/src/zh/UserGuide/Master/Table/SQL-Manual/SQL-Data-Addition-Deletion.md
b/src/zh/UserGuide/Master/Table/SQL-Manual/SQL-Data-Addition-Deletion.md
index 0493da39..35abe369 100644
--- a/src/zh/UserGuide/Master/Table/SQL-Manual/SQL-Data-Addition-Deletion.md
+++ b/src/zh/UserGuide/Master/Table/SQL-Manual/SQL-Data-Addition-Deletion.md
@@ -53,8 +53,8 @@ insert into table1("地区", "厂号", "设备号", "型号", "维修周期", Ti
```SQL
insert into table1
values
-('北京', '3001', '3', '1', '10', 4, 90.0, 1200.0),
-('北京', '3001', '3', '1', '10', 5, 90.0, 1200.0);
+(4, '北京', '3001', '3', '1', '10', 90.0, 1200.0),
+(5, '北京', '3001', '3', '1', '10', 90.0, 1200.0);
insert into table1
("地区", "厂号", "设备号", Time, "温度", "排量")
diff --git a/src/zh/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md
b/src/zh/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md
index ee7a9e8a..75bd8d64 100644
--- a/src/zh/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md
+++ b/src/zh/UserGuide/latest-Table/Basic-Concept/Write-Updata-Data.md
@@ -39,6 +39,7 @@ INSERT INTO <TABLE_NAME> [(COLUMN_NAME[, COLUMN_NAME]*)]?
VALUES (COLUMN_VALUE[,
4. 若当前设备(由标识信息定位)不存在该属性列的值,执行写入操作将导致原有的空值(NULL)被写入的数据所替代。
5. 若当前设备(由标识信息定位)已有属性列的值,再次写入相同的属性列时,系统将更新该属性列的值为新数据。
6. 写入重复时间戳,原时间戳对应列的值会更新。
+7. 若 INSERT 语句未指定列名(如 INSERT INTO table VALUES (...)),则
VALUES中的值必须严格按表中列的物理顺序排列(顺序可通过 DESC table命令查看)。
由于属性一般并不随时间的变化而变化,因此推荐以 update 的方式单独更新属性值,参见下文 [数据更新](#数据更新)。
@@ -162,8 +163,8 @@ insert into table1("地区", "厂号", "设备号", "型号", "维修周期", Ti
```SQL
insert into table1
values
-('北京', '3001', '3', '1', '10', 4, 90.0, 1200.0),
-('北京', '3001', '3', '1', '10', 5, 90.0, 1200.0);
+(4, 北京', '3001', '3', '1', '10', 90.0, 1200.0),
+(5, 北京', '3001', '3', '1', '10', 90.0, 1200.0);
insert into table1
@@ -176,7 +177,7 @@ values
#### 注意事项
- 如果在 SQL 语句中引用了表中不存在的列,IoTDB 将返回错误码 `COLUMN_NOT_EXIST(616)`。
-- 如果写入的数据类型与表中列的数据类型不一致,将报错 `DATA_TYPE_MISMATCH(507)`。
+- 如果写入的数据类型与表中列的数据类型不一致,将报错 `DATA_TYPE_MISMATCH(507)`。
## 2. 数据更新
diff --git
a/src/zh/UserGuide/latest-Table/SQL-Manual/SQL-Data-Addition-Deletion.md
b/src/zh/UserGuide/latest-Table/SQL-Manual/SQL-Data-Addition-Deletion.md
index 0493da39..35abe369 100644
--- a/src/zh/UserGuide/latest-Table/SQL-Manual/SQL-Data-Addition-Deletion.md
+++ b/src/zh/UserGuide/latest-Table/SQL-Manual/SQL-Data-Addition-Deletion.md
@@ -53,8 +53,8 @@ insert into table1("地区", "厂号", "设备号", "型号", "维修周期", Ti
```SQL
insert into table1
values
-('北京', '3001', '3', '1', '10', 4, 90.0, 1200.0),
-('北京', '3001', '3', '1', '10', 5, 90.0, 1200.0);
+(4, '北京', '3001', '3', '1', '10', 90.0, 1200.0),
+(5, '北京', '3001', '3', '1', '10', 90.0, 1200.0);
insert into table1
("地区", "厂号", "设备号", Time, "温度", "排量")