In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
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.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.