Hi,
I have a large procedure, so I want to know if I'm right before I will compile it. I have this statement in t-sql:
if exists (select * from Z07_NUM_STREAM where NUM_STREAM_CODE=parm_SEQ_CODE and NEXT_SEQ_NUM<END_SEQ_NUM and parm_PERIOD between STREAM_START_PERD and STREAM_END_PERD) then [..]
and I want to replace 'exists' like that:
declare
v_if_exists1 integer;
begin
select count(*)
into v_if_exists1
from Z07_NUM_STREAM where NUM_STREAM_CODE=parm_SEQ_CODE and NEXT_SEQ_NUM<END_SEQ_NUM and parm_PERIOD between STREAM_START_PERD and STREAM_END_PERD;
if v_if_exists1 >= 1
then [...]
Thanks for reply.