Code Listing 3: Workaround function for optimal_plan

CREATE OR REPLACE PACKAGE analyze_rates_wa
IS
   FUNCTION optimal_plan (id_in IN company.ID%TYPE)
      RETURN analyze_rates.optimal_info_rt;
END analyze_rates_wa; 
/

CREATE OR REPLACE PACKAGE BODY analyze_rates_wa
IS
   FUNCTION optimal_plan (id_in IN company.ID%TYPE)
      RETURN analyze_rates.optimal_info_rt
   IS
      retval analyze_rates.optimal_info_rt;
   BEGIN
      retval := analyze_rates.optimal_plan (id_in);
	  
     -- Workaround for bug #2056689: is_optimal always returns TRUE; a plan is not
     -- optimal if level and rate are both null. When bug is fixed, remove the following
     -- line and then we will be using the new functionality!
	  
      retval.is_optimal :=
           NOT (retval.rate_level IS NULL AND retval.rate_type IS NULL
               );
			   
      RETURN retval;
   END optimal_plan;
END analyze_rates_wa;
/

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy