K
kongfei
Unregistered / Unconfirmed
GUEST, unregistred user!
pid:=project.FieldValues['pid']; //主表project的id号
projectjoiner1.Active:=true;
projectjoiner1.First;
while not projectjoiner1.Eof do
begin
if pid=projectjoiner1.fieldbyname('pid').asinteger then //在从表projectjoiner1中找到符合条件的记录
begin
pname:=trim(projectjoiner1.fieldbyname('name').AsString);
pweight:=trim(projectjoiner1.fieldbyname('weight').AsString);
strlink:=strlink+pname+'('+pweight+')';//把这些记录拼合成字符串
end;
projectjoiner1.Next;
end;
update project //接着更新主表
set 项目承担人=:strlink
where pid=id
这个过程我想用存储过程实现,可是不知道怎么写,谁能帮帮忙。
projectjoiner1.Active:=true;
projectjoiner1.First;
while not projectjoiner1.Eof do
begin
if pid=projectjoiner1.fieldbyname('pid').asinteger then //在从表projectjoiner1中找到符合条件的记录
begin
pname:=trim(projectjoiner1.fieldbyname('name').AsString);
pweight:=trim(projectjoiner1.fieldbyname('weight').AsString);
strlink:=strlink+pname+'('+pweight+')';//把这些记录拼合成字符串
end;
projectjoiner1.Next;
end;
update project //接着更新主表
set 项目承担人=:strlink
where pid=id
这个过程我想用存储过程实现,可是不知道怎么写,谁能帮帮忙。