使用连接在 table 中插入多行
Insert multiple rows in table with a join
我正在尝试根据联接和联接的特定条件填充 TablA table,我已根据我发现的一些示例尝试了以下 2 个作业。但我不确定如何在保持工作简单的同时填写 table。
我试过以下工作,但都给我一个语法错误:
static void AddDescription(Args _args)
{
TableA tableA;
InventTable inventTable;
str info;
;
ttsBegin;
insert_recordSet tableA
setting
tableA.ItemId = inventTable.ItemId;
tableA.Description = 'DescriptionHere';
join ItemId from inventTable
where TableA.ItemId == inventTable.ItemId &&
where CriteriaA == CriteriaValueA;
tableA.insert();
ttsCommit;
info("Done!");
}
我也尝试过以下工作:
static void AddDescription(Args _args)
{
TableA tableA;
InventTable inventTable;
str info;
;
ttsBegin;
insert_recordSet tableA
join ItemId from inventTable
where CriteriaA == CriteriaValueA;
tableA.ItemId = inventTable.ItemId;
tableA.Description = 'DescriptionHere';
tableA.insert();
ttsCommit;
info("Done!");
}
显然我错过了一大步,谁能给我一个完成这项工作的方向?
你的语法不对。检查函数的文档,因为它非常全面并且有很多示例:https://msdn.microsoft.com/en-us/library/aa635694.aspx?f=255&MSPPError=-2147217396
这是一个可能与您相关的示例:
INSERT_RECORDSET tabEmplProj5
(
Description
, EmployeeRecId
, ProjectRecId
)
Select
sDescriptionVariable
, RecId
from
tabEmpl3
join
tabDept2
where tabEmpl3 .DepartmentGuid == tabDept2 .DepartmentGuid
join RecId
from tabProj4
where tabDept2 .DepartmentGuid == tabProj4 .DepartmentGuid
;
我正在尝试根据联接和联接的特定条件填充 TablA table,我已根据我发现的一些示例尝试了以下 2 个作业。但我不确定如何在保持工作简单的同时填写 table。
我试过以下工作,但都给我一个语法错误:
static void AddDescription(Args _args)
{
TableA tableA;
InventTable inventTable;
str info;
;
ttsBegin;
insert_recordSet tableA
setting
tableA.ItemId = inventTable.ItemId;
tableA.Description = 'DescriptionHere';
join ItemId from inventTable
where TableA.ItemId == inventTable.ItemId &&
where CriteriaA == CriteriaValueA;
tableA.insert();
ttsCommit;
info("Done!");
}
我也尝试过以下工作:
static void AddDescription(Args _args)
{
TableA tableA;
InventTable inventTable;
str info;
;
ttsBegin;
insert_recordSet tableA
join ItemId from inventTable
where CriteriaA == CriteriaValueA;
tableA.ItemId = inventTable.ItemId;
tableA.Description = 'DescriptionHere';
tableA.insert();
ttsCommit;
info("Done!");
}
显然我错过了一大步,谁能给我一个完成这项工作的方向?
你的语法不对。检查函数的文档,因为它非常全面并且有很多示例:https://msdn.microsoft.com/en-us/library/aa635694.aspx?f=255&MSPPError=-2147217396
这是一个可能与您相关的示例:
INSERT_RECORDSET tabEmplProj5
(
Description
, EmployeeRecId
, ProjectRecId
)
Select
sDescriptionVariable
, RecId
from
tabEmpl3
join
tabDept2
where tabEmpl3 .DepartmentGuid == tabDept2 .DepartmentGuid
join RecId
from tabProj4
where tabDept2 .DepartmentGuid == tabProj4 .DepartmentGuid
;