我在使用存储过程的时候,使用了下面的语句:
where field1= case
when @a1='' then field1
else @a1 end
后,在DELPHI中使用存储过程这个数据源来打开数据库时,就会有提示List index out of bounds(1).不知道这里有没有人知道这是怎么回事,关且在括号中的数字可能是如果正确返回时的记录条数!
请帮忙!
where field1= case
when @a1='' then field1
else @a1 end
后,在DELPHI中使用存储过程这个数据源来打开数据库时,就会有提示List index out of bounds(1).不知道这里有没有人知道这是怎么回事,关且在括号中的数字可能是如果正确返回时的记录条数!
请帮忙!
2 不太懂你的意思,为什么会在where利用这样的语句
3 语句应该没有语法错误,可能是你其他的地方引用错误,把代码贴出来吧
--销售单号
-- and t4.fbillno >=isnull( @BILLNOS,t4.fbillno) and t4.fbillno <= isnull(@BILLNOE,t4.fbillno)
and t4.fbillno >= case
when @BILLNOS ='' THEN t4.fbillno
when @BILLNOS is null THEN t4.fbillno
when @BILLNOS = 'all' THEN '0' else @BILLNOS end
and t4.fbillno <= case
when @BILLNOE ='' THEN t4.fbillno
when @BILLNOE is null THEN t4.fbillno
when @BILLNOE = 'all' THEN 'ZZZZZZZZZZ'
else @BILLNOE end
--客户税纳税号
and t1.ftaxnum = case when
@SWDJH ='' then t1.ftaxnum
when @SWDJH is null then t1.ftaxnum
when @SWDJH='all' then t1.ftaxnum
else @SWDJH end
--客户名称
and t1.fname= case when
@CLIENTN ='' then t1.fname
when @CLIENTN is null then t1.fname
when @CLIENTN = 'all' then t1.fname
else @CLIENTN end
还请各位帮忙!----------------------重分答谢!---------------
在你给参数赋值的时候不要使用数组的下标,而直接使用StoredProc的ParamsByName()这个属性来给参数赋值,这样就不会引起上面的问题!
我觉得应该是delphi中调用部分的错,从存储过程中看不出有什么问题。