这段代码运行时出错,数据库版本为:DBISAM4.05
SQL.Add('update KC a,XS b set a.数量=a.数量-b.数量 where a.编号=b.编号 and a.品名=b.品名');出错提示如下:
DBISAM Engine Error # 11949 SQL error - 'SET keyword expected, instead found ',''望指点。
SQL.Add('update KC a,XS b set a.数量=a.数量-b.数量 where a.编号=b.编号 and a.品名=b.品名');出错提示如下:
DBISAM Engine Error # 11949 SQL error - 'SET keyword expected, instead found ',''望指点。
set 数量=a.数量-b.数量
from KC a, XS b
where a.编号=b.编号 and a.品名=b.品名
改成这样
SQL.Add('Update KC');
SQL.Add('set 数量=a.数量-b.数量');
SQL.Add('from KC a, XS b');
SQL.Add('where a.编号=b.编号 and a.品名=b.品名');出错提示如下:
DBISAM Engine Error # 11949 SQL error - 'The first source table specified in FROM clause must match the table being updated in the UPDATE statement'
SQL.Add('set [数量]=[a.数量]-[b.数量]');
SQL.Add('from KC a, XS b');
SQL.Add('where a.编号=b.编号 and a.品名=b.品名');