Oracle FAQ Your Portal to the Oracle Knowledge Grid

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

RE: Interesting Exploit in PL/SQL

From: Jacques Kilchoer <>
Date: Thu, 30 Nov 2006 10:34:24 -0800
Message-ID: <>

So if your procedure was only able to enable auditing on half the objects in the database, and failed to enable auditing on the other half, you didn't care? I guess in this case it would make sense. But then the other option would be to not run the procedure at all, if you didn't care which objects had auditing enabled.

De : Stefan Knecht [] Envoyé : jeudi, 30. novembre 2006 02:18
À : Jacques Kilchoer
Cc : oracle-l
Objet : Re: Interesting Exploit in PL/SQL

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

noaudit all on x.y;
when others then null;

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.


On 11/29/06, Jacques Kilchoer <> 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 : [] 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
Received on Thu Nov 30 2006 - 12:34:24 CST

Original text of this message