Oracle stored procedure code you posted in the first message suggests that IF checks two variables (or functions?); the first one (pmanagedstatuscode) being Boolean, another one (porganizationid) number. If the condition is TRUE, you are setting the third variable (perrorcode to 3). With Boolean, you don't need to specify its value so your code might evaluate to
Code:
if not pmanagedstatuscode and porganizationid <> 0 then
perrorcode := 3;
end if;
Obviously, you don't need a SELECT statement to set PERRORCODE's value. However, if you insist, no problem either:
Code:
select 3 into perrorcode from dual;