set 赋值问题
如下定义变量
--组合条件(盘点)
declare @ChaXunZuHe varchar(4000);
--组合条件出,入,调库
declare @ChuRuTiaoZuHe varchar(4000);
下边的赋值方法
set @ChaXunZuHe=(' select shijishuliang,CangKuBianHao,CangKu,BianHao,MingChen,GuiGe,SuoShuGongChang from ( '
+@FromTable+' )A'+' where 1=1 ')
--print @ChaXunZuHe;
--组合出,入,调库中的查询
set @ChuRuTiaoZuHe= (' select * from View_ImEx where 1=1 ')
--print @ChuRuTiaoZuHe;
if len(rtrim(@CaiLiaoBianHao))<>0
begin
--材料编号不为空 盘点组合条件
set @strCalLiaoBianHao=(' and BianHao='+''+''''+@CaiLiaoBianHao+'''');
--材料编号不为空 出入调库组合条件
set @strCRTCaiLiaoBianHao=(' and CaiLiaoBianHao='+''+''''+@CaiLiaoBianHao+'''');
set @ChaXunZuHe=(@ChaXunZuHe+@strCalLiaoBianHao);
set @ChuRuTiaoZuHe=(@ChuRuTiaoZuHe+@strCRTGongChangBianHao);
print 1
print @ChuRuTiaoZuHe
print 2
end
print @ChuRuTiaoZuHe 这时候打印为空的为什么 我的这个if 没有问题 此变量不为空我打印出来看了
而且pring @ChaXunZuHe 里边是有值的
--组合条件(盘点)
declare @ChaXunZuHe varchar(4000);
--组合条件出,入,调库
declare @ChuRuTiaoZuHe varchar(4000);
下边的赋值方法
set @ChaXunZuHe=(' select shijishuliang,CangKuBianHao,CangKu,BianHao,MingChen,GuiGe,SuoShuGongChang from ( '
+@FromTable+' )A'+' where 1=1 ')
--print @ChaXunZuHe;
--组合出,入,调库中的查询
set @ChuRuTiaoZuHe= (' select * from View_ImEx where 1=1 ')
--print @ChuRuTiaoZuHe;
if len(rtrim(@CaiLiaoBianHao))<>0
begin
--材料编号不为空 盘点组合条件
set @strCalLiaoBianHao=(' and BianHao='+''+''''+@CaiLiaoBianHao+'''');
--材料编号不为空 出入调库组合条件
set @strCRTCaiLiaoBianHao=(' and CaiLiaoBianHao='+''+''''+@CaiLiaoBianHao+'''');
set @ChaXunZuHe=(@ChaXunZuHe+@strCalLiaoBianHao);
set @ChuRuTiaoZuHe=(@ChuRuTiaoZuHe+@strCRTGongChangBianHao);
print 1
print @ChuRuTiaoZuHe
print 2
end
print @ChuRuTiaoZuHe 这时候打印为空的为什么 我的这个if 没有问题 此变量不为空我打印出来看了
而且pring @ChaXunZuHe 里边是有值的
...全文
相关推荐
关于C语言指针赋值的问题详解
本篇文章是对C语言指针赋值的问题进行了详细的分析介绍,需要的朋友参考下
C#中字段、属性、只读、构造函数赋值、反射赋值的问题
主要介绍了C#中字段、属性、只读、构造函数赋值、反射赋值的问题 ,非常不错,具有一定的参考借鉴借鉴价值,需要的朋友可以参考下
java反射给指定字段赋值
反射给指定字段赋值
javascript连续赋值问题
本文通过具体的示例来给大家详细解释了下javascript的连续赋值问题,十分的实用,有需要的小伙伴可以参考下。
vue踩坑记录之数组定义和赋值问题
主要给大家介绍了关于vue踩坑记录之数组定义和赋值问题的相关资料,文中通过示例代码介绍的非常详细,对大家学习或者使用vue具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧


非技术版
