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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Interesting Exploit in PL/SQL

Re: Interesting Exploit in PL/SQL

From: Stefan Knecht <knecht.stefan_at_gmail.com>
Date: Thu, 30 Nov 2006 11:18:24 +0100
Message-ID: <486b2b610611300218i781a32d8qb98be21354fc45dc@mail.gmail.com>


There are situations where you can use when others then null; - and it even makes sense.

For example, we've had a procedure to enable / disable auditing on all objects in a database. To avoid having to filter out all possible errors due to the huge number of different objects (and especially the sys objects) we used a construct like

begin
noaudit all on x.y;
exception
when others then null;
end;

If the noaudit fails for whatever reason (we just don't care why here), we simply go on to the next object. That was perfectly fine for this case.

Stefan

On 11/29/06, Jacques Kilchoer <Jacques.Kilchoer_at_quest.com> wrote:
>
> What does this below mean? Are you trying to say "when you MUST make sure
> that the program NEVER stops, regardless of whatever errors I encounter" ?
> If so, I can't imagine why someone would want to do that.
>
> -----Message d'origine-----
> De : oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org]
> De la part de Nuno Souto
> Envoyé : mercredi, 29. novembre 2006 00:26
> Cc : Oracle-L Freelists
> Objet : Re: Interesting Exploit in PL/SQL
>
>
> 4- If you don't know what error can be generated but you MUST run the code
> nevertheless, then you MUST use WHEN OTHERS THEN NULL. Or pay the price of
> a temp table to keep all possible return codes. Otherwise your code won't
> run. No, I will NOT recommend coding exceptions for 20000 possible error
> returns!
>
>
> So, rather than embark in yet another crusade of calling anyone who
> doesn't follow the fad an incompetent by nature, can we just for once
> address the problem at the root?
>
> And ask Oracle to fix it first rather than blame everyone else for it?
>
> --
> Cheers
> Nuno Souto
> in windy Sydney, Australia
> dbvision_at_iinet.net.au
> --
> http://www.freelists.org/webpage/oracle-l
>
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Nov 30 2006 - 04:18:24 CST

Original text of this message

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