如何向扳手表中输入数据?

问题描述 投票:0回答:1

我有一个扳手桌

report_config
。 看起来像:

+----------------------+--------------+
|         col_name     |  data_type   |
+----------------------+--------------+
| report_id            | INT64        |
| report_name          | string       |
| report_type          | string       |
+----------------------+--------------+

现在

report_id
是主键。它有这样的条目:

+-------------+--------------+--------------+
| report_id   |  report_name |  report_type |
+-------------+--------------+--------------+
| 1           | report1      | 1st_report   |
| 2           | report2      | 2nd_report   |
| 10          | report10     | 10th_report  |
+-------------+--------------+--------------+

问题发生在我尝试将带有

report_id=3
的新行插入表中时: 错误
Statement failed: Row [3] in report_config was already inserted in this transaction.

google-cloud-spanner
1个回答
0
投票

此错误表明您已在同一事务中至少插入该行一次。请检查您的应用程序,看看您是否不小心多次执行此写入/插入操作。

© www.soinside.com 2019 - 2024. All rights reserved.