Initialization of 2011-11-25 packet
Http://www.itpub.net/thread-1499223-20-1.html
191 floor
In order to encourage visitors to use our website more and more, we give points for their activities. Our integral calculation method is the product of the basic points and the coefficient. If the activity occurs before 08:00, the coefficient is 3; if it occurs before 16:00, the coefficient is 2; the other coefficient is 1. This formula is implemented with the following functions:
CREATE OR REPLACE FUNCTION plch_multiplierRETURN PLS_INTEGERIS c_hour CONSTANT PLS_INTEGER: = TO_NUMBER (TO_CHAR (SYSDATE, 'HH24')); BEGINRETURN CASE WHEN c_hour < 8 THEN 3 WHEN c_hour < 16 THEN 2 ELSE 1 END;END;/
Then I use the functions in this package to calculate the points for the activity:
CREATE OR REPLACE PACKAGE plch_pkgIS FUNCTION points_for_activity (base_points_in IN INTEGER) RETURN PLS_INTEGER;END;/
Without assuming that our application is state-dependent or state-independent, which options implement the package body so that the calculation is always correct?
(A)
CREATE OR REPLACE PACKAGE BODY plch_pkgIS g_multiplier PLS_INTEGER; FUNCTION points_for_activity (base_points_in IN INTEGER) RETURN PLS_INTEGER IS BEGIN RETURN base_points_in * glosser; END;BEGIN g_multiplier: = plch_multiplier (); END;/
(B)
CREATE OR REPLACE PACKAGE BODY plch_pkgIS FUNCTION points_for_activity (base_points_in IN INTEGER) RETURN PLS_INTEGER IS BEGIN RETURN base_points_in * plch_multiplier (); END;END;/
(C)
CREATE OR REPLACE PACKAGE BODY plch_pkgIS g_multiplier PLS_INTEGER; FUNCTION points_for_activity (base_points_in IN INTEGER) RETURN PLS_INTEGER IS BEGIN IF g_multiplier IS NULL THEN g_multiplier: = plch_multiplier (); END IF; RETURN base_points_in * glitter; END;END;/
(D)
CREATE OR REPLACE PACKAGE BODY plch_pkgIS g_multiplier PLS_INTEGER: = plch_multiplier (); FUNCTION points_for_activity (base_points_in IN INTEGER) RETURN PLS_INTEGER IS BEGIN RETURN base_points_in * gkeeper; END;END;/
The answer is on the 194th floor.
2011-11-25 answer B. Other words are "static" and cannot be taken to the current time.