从Visual FoxPro表

时间:2016-06-19 03:26:39

标签: mysql sql insert foxpro

我有一个Visual FoxPro表,我用来更新MySql表,布局是相同的。我的插入语句是:

SQLEXEC(comm,[INSERT INTO unpaid (sms, salesman, ourinv, date, custcode, customer, custpay, amtpd) values(?k_unpaid.sms, ?k_unpaid.salesman, ?k_unpaid.ourinv, ?k_unpaid.date, ?k_unpaid.custcode, ?k_unpaid.customer, ?k_unpaid.custpay, ?k_unpaid.amtpd)])

还有4个我需要更新的列但是当我将它们包含在上面的语句中时,我得到“命令包含无法识别的短语/关键字”

其他栏目是:

custpay
salescom
totcust
totcom

同样,表结构是相同的,我已经尝试添加所有4列并且我得到了错误,我尝试仅向查询中添加一个附加列并仍然得到错误。

1 个答案:

答案 0 :(得分:0)

我认为问题在于您传递的指令长于允许的引用字符串长度。首先尝试构建字符串,然后将其作为变量传递给SQLExec()。最简单的方法是使用TEXT命令:

TEXT TO m.cSQL
INSERT INTO unpaid (sms, salesman, ourinv, date, custcode, customer, custpay, amtpd) values(?k_unpaid.sms, ?k_unpaid.salesman, ?k_unpaid.ourinv, ?k_unpaid.date, ?k_unpaid.custcode, ?k_unpaid.customer, ?k_unpaid.custpay, ?k_unpaid.amtpd)
ENDTEXT

SQLEXEC(comm, m.cSQL)