首页 > 数据库技术 > 详细

一次性打包插入数据库 RecordInsertList

时间:2019-06-09 14:05:20      阅读:129      评论:0      收藏:0      [点我收藏+]
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

原文:https://www.cnblogs.com/xtwkh1973/p/10993129.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!