Re: Interesting Exploit in PL/SQL

  • From: "Stefan Knecht" <knecht.stefan@xxxxxxxxx>
  • To: Jacques.Kilchoer@xxxxxxxxx
  • Date: Thu, 30 Nov 2006 11:18:24 +0100

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@xxxxxxxxx> 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@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
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@xxxxxxxxxxxx
--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l



Other related posts: