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

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle For Fun

Re: Oracle For Fun

From: Jeff <jeff_at_work.com>
Date: Tue, 03 Feb 2004 15:46:07 GMT
Message-ID: <bvofo0$slk$1@cronkite.cc.uga.edu>


In article <nGOTb.213791$xy6.1102746_at_attbi_s02>, "VC" <boston103_at_hotmail.com> wrote:

>> Changing this line to:
>>
>> if NOT f1(l.x) then l_str := 'not valid'; else l_str := 'valid'; end if;
>
>Is not the trick you've just played called 'creating a strawman' in
>logic 101 ? My if-statement handles NULLs just fine, thank you.

It's not a "trick"... and what logic 101 course did you take? You don't always know how someone will use your function, so you should not assume that it will not be tested for a FALSE value.

>> .. and you'll get different results when you shouldn't.
>
>
>No, I won't as the test code snippet clearly shows.

Which snippet? Clearly shows what? That if you run it the "right" way, that it'll produce the "right" results? The only thing that is "clear" to me is that you're assuming there is only one "right" way.

As I said, if the specification is that NULL values are "invalid" and the return value is FALSE (as is the case in the "traditional" test), then translate2 is clearly wrong. OTOH, if NULLs are NOT "invalid" and the routine should return NULL, then translate2 is fine... and all the others are wrong. Since this wasn't clearly specified from the beginning... it's all a push and we should just leave it at that. Received on Tue Feb 03 2004 - 09:46:07 CST

Original text of this message

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