0
if 0 <> (select count(*) from sung where hakbun = 1)then
cnt := cnt+1;
end if;

I tried to above source and Oracle shows blow error

PLS-00405: subquery not allowed in this context

What am i doing wrong?

Pரதீப்
  • 91,748
  • 19
  • 131
  • 172
Nick
  • 139
  • 2
  • 9

1 Answers1

1

How about doing the whole thing in a single query? Does this work?

select cnt + (case when count(*) > 0 then 1 else 0 end) into cnt
from sung
where hakbun = 1;
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786