Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> How Do I execute this from SQL PLUS?

How Do I execute this from SQL PLUS?

From: Viktor <stant_98_at_yahoo.com>
Date: Thu, 17 Aug 2000 11:17:47 -0700 (PDT)
Message-Id: <10592.114880@fatcity.com>


Hi, All
I've got a real quick question?

How do I exec this:

CREATE OR REPLACE PACKAGE emp_actions AS

   TYPE EmpRecTyp IS RECORD (emp_id INTEGER, salary REAL);
   CURSOR desc_salary RETURN EmpRecTyp;
   FUNCTION nth_highest_salary (n INTEGER) RETURN EmpRecTyp;
END emp_actions;
/

CREATE OR REPLACE PACKAGE BODY emp_actions AS  CURSOR desc_salary RETURN EmpRecTyp
 IS
  SELECT empno, sal
  FROM emp
  ORDER BY sal DESC;
 FUNCTION nth_highest_salary (n INTEGER) RETURN EmpRecTyp
 IS
  emp_rec EmpRecTyp;
 BEGIN
   OPEN desc_salary;
   FOR i IN 1..n LOOP
     FETCH desc_salary INTO emp_rec;
   END LOOP;
    CLOSE desc_salary;
     RETURN emp_rec;
   END nth_highest_salary;
 END emp_actions;
/



Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger. Received on Thu Aug 17 2000 - 13:17:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US