内存变量应用错误
VFP+SQL:
m.dengluname="005"
TEXT TO m.HX_SQLCmd10 NOSHOW TEXTMERGE
select CAST(0 AS BIT),A.*,
P.user_name as 制单人姓名
FROM CheDuiFeiYong A
LEFT JOIN user_password P ON A.zhidanid=P.user_id
where (old_to_new = 1 and rukuid is null and A.zhidanid = m.dengluname)
ENDTEXT
?SQLEXEC(nhandle,m.HX_SQLCmd10,"CheDuiFeiYongDele_temp")
现象:如果去掉上述红色部分,值=1
如果不去掉上述红色部分,值=-1
why?
[解决办法]
假设为字符型
m.dengluname="005"
TEXT TO m.HX_SQLCmd10 NOSHOW TEXTMERGE
select CAST(0 AS BIT),A.*,
P.user_name as 制单人姓名
FROM CheDuiFeiYong A
LEFT JOIN user_password P ON A.zhidanid=P.user_id
where (old_to_new = 1 and rukuid is null and A.zhidanid ='<<m.dengluname>>')
ENDTEXT
? m.HX_SQLCmd10