Re: Stored Proc Fails

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 4 Jun 2003 10:28:49 -0700
Message-ID: <92eeeff0.0306040928.64b53345_at_posting.google.com>


dgnatek_at_flash.net (David) wrote in message news:<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.

Add RAISE; to your exception block to see what particular error message you are getting. Don't just assume it's a "privelege thing".

Regards
/Rauf Sarwar Received on Wed Jun 04 2003 - 19:28:49 CEST

Original text of this message