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

Home -> Community -> Usenet -> c.d.o.misc -> Re: P/L SQL Exception

Re: P/L SQL Exception

From: Manh-Hoa Le <at770_at_FreeNet.Carleton.CA>
Date: 1997/02/16
Message-ID: <5e5qro$nu2@freenet-news.carleton.ca>#1/1

Amine Y. Tarhini (atarhini_at_ringer.cs.utsa.edu) writes:
> In order to automate the task of deleting some records, I wrote a small
> SQL*Plus script with a P/L SQL block to do this.
>
> At the begining of the P/L SQL block, I check the USER variable, and
> based on its value, I raise an exception if the operator should not be
> deleting records. However, When testing the script logged in as a user who
> has no such privilege, I get the following errors
> ORA-06550: line .. column ..
> PLS-00904: insufficient privilege to ..
> ORA-06550: line .. column ..
> PL/SQL: SQL statement ignored.
> and the script won't even run. (it does if the user has privileges).
>
> I tried to trap this error with the WHEN OTHERS THEN clause, then by the
> PRAGMA EXCEPTION_INIT(my_exception,-6550), but neither method worked.
>
> Is there a way to get around this? and why doesn't ORACLE wait until an
> attempt to delete and/or update is actually made to return the error?
> In the above script, they won't even be executed based on the initial check.

  1. Those errors are caught at compiling phase where EXCEPTION ones could only be at executing phase.
  2. At sqlplus promtp, enter: show errors <return> Correct the errors (I think you have no privilege to something and run the script over again.

>
> Your help is appreciated, whether Post or E-mail..
> --
> Amine.
> atarhini_at_ringer.cs.utsa.edu
>
> The above views are mine only ... etc. etc.
Received on Sun Feb 16 1997 - 00:00:00 CST

Original text of this message

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