Stored Proc Fails

From: David <dgnatek_at_flash.net>
Date: 4 Jun 2003 06:27:41 -0700
Message-ID: <9b514443.0306040527.772304fc_at_posting.google.com>


Being new to Oracle stored procs I am having a little trouble here. I have the following stored proc which always fails:

CREATE OR REPLACE PACKAGE my_package AS

   FUNCTION my_function RETURN NUMBER;
END my_package;
/

CREATE OR REPLACE PACKAGE BODY my_package AS

   FUNCTION my_function RETURN NUMBER IS    BEGIN

      DELETE FROM headersfile;
      RETURN -1;
     
      EXCEPTION 
         WHEN OTHERS THEN
         RETURN 0;

   END my_function;
END my_package;

When I run the delete manually in SQLPlus it works. I then create a package (successfully) and run it my typing "SELECT my_package.my_function FROM dual;" However, it always returns 0. Is this a privelege thing? If so, how do I resolve it? BTW, I have noticed I can perform Selects from the table (in the stored proc) and all works well. Thks for any input.

David. Received on Wed Jun 04 2003 - 15:27:41 CEST

Original text of this message