CREATE OR REPLACE PROCEDURE Check_credit
(LIMIT NUMBER)
AS
rating NUMBER := 3;
FUNCTION Check_rating
RETURN BOOLEAN
IS
rating NUMBER := 1;
over_limit BOOLEAN;
BEGIN
IF check_credit.rating <= LIMIT THEN
over_limit := false;
ELSE
rating := LIMIT;
over_limit := true;
END IF;
RETURN over_limit;
END check_rating;
BEGIN
IF check_rating THEN
dbms_output.Put_line('Credit rating over limit ('
||To_char(LIMIT)
||').'
||' Rating: '
||To_char(rating));
ELSE
dbms_output.Put_line('Credit rating OK. '
||'Rating: '
||To_char(rating));
END IF;
END;
/
CALL check_credit(1);
Using Subprogram Qualifier With Identifiers
0 comments:
Post a Comment