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

Home -> Community -> Usenet -> c.d.o.server -> Newbie PL/SQL Question

Newbie PL/SQL Question

From: Greg H <greg_horie_at_telus.net>
Date: Mon, 10 Mar 2003 05:02:19 GMT
Message-ID: <v%Uaa.11337$wW.1067689@news2.telusplanet.net>


Hey Folks,

I'm just starting to learn a little PL/SQL (enough to be dangerous). I was trying to create a simple package that referenced the hr.emp_details_view example view. Unfortunately, I get the following error in reference to this view:

PL/SQL: ORA-00942: table or view does not exist

I'm thinking this is a scope or permissions issue since I seem to be able to access this table using a straight SQL query, but I'm not sure what I need to do to correct it. Any suggestions?

Thanks,


CREATE OR REPLACE PACKAGE test_package
AS

   PROCEDURE pl(message VARCHAR2);

   PROCEDURE emp_details;
END test_package;
/



CREATE OR REPLACE PACKAGE BODY test_package AS

PROCEDURE pl(message VARCHAR2)
IS
BEGIN
   DBMS_OUTPUT.PUT_LINE(message);
END pl;

PROCEDURE emp_details
IS
BEGIN
   pl('emp_details stub()');
   FOR emps IN

      (SELECT first_name, last_name, city, country_name, salary
       FROM   hr.emp_details_view)
   LOOP
      <<list_details>>
      pl(emps%ROWCOUNT     || ') ' ||
      emps.first_name   || ', ' ||
   emps.last_name    || ', ' ||
   emps.city         || ', ' ||
   emps.country_name || ', ' ||
   emps.salary                 );

   END LOOP list_details;
END emp_details;

END test_package;
/
Received on Sun Mar 09 2003 - 23:02:19 CST

Original text of this message

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