将数据逐行插入任何逻辑数据库?
Insert data row by row into anylogic database?
我在加载数据的任何逻辑数据库中有一个 table og_table
。从 table 开始,我以编程方式遍历 selectResultSet
,现在我想通过一些转换将这些行重写为 new_table
。我当时的计划只是 运行 一些 INSERT table ... values()
查询到 new_table
中,然后逐行写入。
但是,我对使用哪种方法的文档有点困惑。我看到了 modify(), InsertQuery(), Insert(),等等。这些方法有什么区别?
如果你想插入新的 table 那么这应该有效:
insertInto(new_table)
.columns(new_table.col1, new_table.col2)
.values("Value 1", "Value 2")
.execute();
您可能还想使用以下语句在模型启动时清除 new_table
:deleteFrom(new_table).execute();
我在加载数据的任何逻辑数据库中有一个 table og_table
。从 table 开始,我以编程方式遍历 selectResultSet
,现在我想通过一些转换将这些行重写为 new_table
。我当时的计划只是 运行 一些 INSERT table ... values()
查询到 new_table
中,然后逐行写入。
但是,我对使用哪种方法的文档有点困惑。我看到了 modify(), InsertQuery(), Insert(),等等。这些方法有什么区别?
如果你想插入新的 table 那么这应该有效:
insertInto(new_table)
.columns(new_table.col1, new_table.col2)
.values("Value 1", "Value 2")
.execute();
您可能还想使用以下语句在模型启动时清除 new_table
:deleteFrom(new_table).execute();