Index | Home | Forums
Oracle PL/SQL Example 2-18 Using Subprogram Qualifier With Identifiers

Example 2-18 Using Subprogram Qualifier With Identifiers

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);


This page was generated on/at Feb 23,2008 00:20:12
General comments and questions regarding this document should be sent by email to info@oracleabc.com or post your comments here




Index | Home | Forums
Oracle PL/SQL Example 2-18 Using Subprogram Qualifier With Identifiers

Example 2-18 Using Subprogram Qualifier With Identifiers

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);


This page was created by oracleabc.com on Feb 23,2008 00:09:02
General comments and questions regarding this document should be sent by email to info@oracleabc.com or post your comments here