sql update 无法更新 null?
sql update无法更新 null:lcsql="update "+lc关联子表+" set "+入库字段+"="+入库字段+"+(select isnull(sum(isnull("+lc工资子表数据字段+",0)),0) from "+lc工资子表+" where RTRIM(LTRIM("+lc工资子表字段+"))='"+c单据PK+"'"+z原工资子表条件字段+lc条件+" group by "+lc工资子表依据字段+") where RTRIM(LTRIM("+lc关联子表字段+"))='"+lc_jlsjh+"'"+z工资子表条件字段
------入库字段为数值型,想改为如下:
lcsql="update "+lc关联子表+" set "+入库字段+"="+isnull(入库字段,0)+"+(select isnull(sum(isnull("+lc工资子表数据字段+",0)),0) from "+lc工资子表+" where RTRIM(LTRIM("+lc工资子表字段+"))='"+c单据PK+"'"+z原工资子表条件字段+lc条件+" group by "+lc工资子表依据字段+") where RTRIM(LTRIM("+lc关联子表字段+"))='"+lc_jlsjh+"'"+z工资子表条件字段
-----在VFP下报错:参数太多
想改为如下:
lcsql="update "+lc关联子表+" set "+入库字段+"="+nvl(入库字段,0)+"+(select isnull(sum(isnull("+lc工资子表数据字段+",0)),0) from "+lc工资子表+" where RTRIM(LTRIM("+lc工资子表字段+"))='"+c单据PK+"'"+z原工资子表条件字段+lc条件+" group by "+lc工资子表依据字段+") where RTRIM(LTRIM("+lc关联子表字段+"))='"+lc_jlsjh+"'"+z工资子表条件字段
----在SQL上报错:nvl不是可认识的内置函数
大侠们,其它地方都没错,怎么改?