一次性打包插入数据库 RecordInsertList
Posted xtwkh1973
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了一次性打包插入数据库 RecordInsertList相关的知识,希望对你有一定的参考价值。
static void recordInsertList(Args _args)
/*The RecordInsertList class allows to insert multiple records in to database.
new() - Creates a new object to hold records for insertion into the database.
add() - Adds a record to a RecordInsertList object for subsequent insertion into the database
insertDatabase() - Inserts all records, that have not already been inserted, in the current
RecordInsertList object.
The following example uses the RecordInsertList class to copy records from one table buffer to another.
*/
void copyBOM(BOMId _FromBOM, BOMId _ToBOM)
RecordInsertList BOMList;
BOM BOM, newBOM;
BOMList = new RecordInsertList(tableNum(BOM));
while select BOM
where BOM.BOMId == _FromBOM
newBOM.data(BOM);
newBOM.BOMId = _ToBOM;
BOMList.add(newBOM);
BOMList.insertDatabase();
以上是关于一次性打包插入数据库 RecordInsertList的主要内容,如果未能解决你的问题,请参考以下文章