Create or Replace Function f_CkSal(Amt Number)
Return Boolean
Is
Begin
Return ( Amt Between 100 And 1000);
End;
/
Select *
From User_Source
Where Name = 'F_CKSAL';
Declare
Sal Number(8,2) := &Salary;
Flag Boolean;
Begin
Flag := F_CkSal(Sal);
If Flag /* or "If Flag = True" */
Then Dbms_Output.Put_Line ( Sal || ' Good' );
Else Dbms_Output.Put_Line ( Sal || ' Bad' );
End If;
End;
/
No comments:
Post a Comment