我在使用存储过程的时候,使用了下面的语句:
where field1= case
when @a1='' then field1
else @a1 end
后,在DELPHI中使用存储过程这个数据源来打开数据库时,就会有提示List index out of bounds(1).不知道这里有没有人知道这是怎么回事,关且在括号中的数字可能是如果正确返回时的记录条数!
请帮忙!
...全文
30713打赏收藏
List index out of bounds(1)!
我在使用存储过程的时候,使用了下面的语句: where field1= case when @a1='' then field1 else @a1 end 后,在DELPHI中使用存储过程这个数据源来打开数据库时,就会有提示List index out of bounds(1).不知道这里有没有人知道这是怎么回事,关且在括号中的数字可能是如果正确返回时的记录条数! 请帮忙!
t4.fdate >=isnull(@BEGDATE,t4.fdate) and t4.fdate <= isnull(@ENDDATE,t4.fdate)
--销售单号
-- 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