我有以下代码,对于非空值完全正常执行,但如果我得到任何Null值变量' @ FORMULA'并没有在调试模式下显示任何内容,即使我包含一个NULL检查验证它没有执行,我得到错误的值。
在这种情况下,有没有办法克服空值的影响?
CREATE TABLE #MathLogicExecution
(
IDNUM INTEGER IDENTITY(1,1),
Expression VARCHAR(256)
)
BEGIN
SELECT @ig =1
WHILE @ig <= @INPUTCOUNT
BEGIN
INSERT INTO #MathLogicExecution
SELECT
REPLACE(@FORMULA, ATTRIBUTENAME, INPUTVALUES)
FROM #MathLogicTable
WHERE IDNUM = @ig
SET @FORMULA = (SELECT Expression FROM #MathLogicExecution
WHERE IDNUM = @ig)
SET @ig = @ig + 1
END
END
IF (@FORMULA = NULL)
BEGIN
SET @iv = @iv + 1
DROP TABLE #MathLogicTable
DROP TABLE #BusinesLogicIDTabe
CONTINUE
END