execute immediate 'select 1 from test where id='||id||' ' into chang;
if chang=1 then --语句1
else --语句2
end if;
当chang的值为1时,过程可以执行。
当chang的值为NULL时,也就是那条SQL语句没有搜出记录。过程中的语句2就不执行了也没有报错。
这是怎么会事啊,应该怎么解决?
谢谢
if chang=1 then --语句1
else --语句2
end if;
当chang的值为1时,过程可以执行。
当chang的值为NULL时,也就是那条SQL语句没有搜出记录。过程中的语句2就不执行了也没有报错。
这是怎么会事啊,应该怎么解决?
谢谢
if (chang is not null) and (chang = 1) then --语句1
else --语句2
end if;