Adaptive Server Enterprise / 15.0.3 / EBF 17157 ESD#3 / P / x86_64 / Enterprise Linux / ase1503/2726/64ビット/FBO/で実行
以下のコードは部分文字列の大文字小文字を区別しないでください。ただし、Sybaseエラー536が表示されます。
これは、実際の値に関係なくすべてのパスを評価する最適化の形式ですか?
これを回避することはできますが、理由を知りたいですか?
declare @test float
declare @test1 char(10)
create table #TestTable
(
Dno int,
Code varchar(10)
)
Insert into #TestTable values (1,'code')
set @test1 = 'ddd'
print 'test'
select @test = case
when (1=1) then 2
when (1=0) then (select Dno FROM #TestTable WHERE Code = substring('abc',1,charindex(@test1,'a')-1) AND Dno = 1)
else 10
end
select @test
drop table #TestTable