free2000000 بتاريخ: 26 مارس 2010 تقديم بلاغ مشاركة بتاريخ: 26 مارس 2010 Create a package, which contains the following functions and procedures, in the HR account. 1. A function that has one input parameter of type NUMBER, and returns the square of its input.2. A function that has three input parameters of type NUMBER, and returns the minimum of its threeinputs.3. A function that has one input parameter of type INTEGER. The function returns TRUE if its input is aprime number and FALSE if its input is not a prime number. A prime number (or a prime) is a naturalnumber that has exactly two distinct natural number divisors: 1 and itself. Here is a list of the firsttwenty prime numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71.4. A procedure that shows the names of employees (lastName, firstName) sorted by last name.5. A procedure that shows the names of employees (firstName lastName) salaries less than 10000.6. A procedure that shows the names of countries sorted by region id.In implementing the 3rd function, you can search the web for algorithms on prime numbers. These algorithmsmay be written in other programming languages. However, you will get the idea on how toimplement the function. Here is a prime testing algorithm written in Python. You may also need to getfamilar with some PL/SQL data types (Figure 1). To get more information, see this PL/SQL datatypes. Youmay need the MOD function in your implementation. اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
free2000000 بتاريخ: 1 أبريل 2010 كاتب الموضوع تقديم بلاغ مشاركة بتاريخ: 1 أبريل 2010 i work in this package a litle but i have some errors can any one correct these for me pleas 01.txt 02.txt اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
burhanse2002 بتاريخ: 19 أبريل 2010 تقديم بلاغ مشاركة بتاريخ: 19 أبريل 2010 CREATE OR REPLACE FUNCTION TEST.max_number ( p_number_a IN NUMBER, p_number_b IN NUMBER, p_number_c IN NUMBER) RETURN NUMBERAS v_number_a NUMBER; v_number_b NUMBER; v_number_c NUMBER; v_max NUMBER;BEGIN v_number_a := p_number_a; v_number_b := p_number_b; v_number_c := p_number_c; IF v_number_a > v_number_b AND v_number_a > v_number_c THEN v_max := v_number_a; ELSIF v_number_b > v_number_a AND v_number_b > v_number_c THEN v_max := v_number_b; ELSIF v_number_c > v_number_a AND v_number_c > v_number_b THEN v_max := v_number_c; END IF; RETURN v_max;END; اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
burhanse2002 بتاريخ: 19 أبريل 2010 تقديم بلاغ مشاركة بتاريخ: 19 أبريل 2010 CREATE OR REPLACE FUNCTION TEST.square_number (p_number IN NUMBER) RETURN NUMBERAS v_number NUMBER;BEGIN v_number := p_number; v_number := v_number * v_number; RETURN v_number;END;[يسار][/يسار] اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
@nana@ بتاريخ: 19 أبريل 2010 تقديم بلاغ مشاركة بتاريخ: 19 أبريل 2010 2. A function that has three input parameters of type NUMBER, and returns the minimum of its threeinputs. create or replace function minnum(v_a number,v_b number,v_c number) return number is begin if(v_a<v_ then if(v_a<v_c) then return v_a; elsif(v_a>v_c) then return v_c; end if; elsif(v_a>v_ then if(v_b<v_c) then return v_b; elsif(v_b>v_c) then return v_c; end if; end if; end ; اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Recommended Posts
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.