"Most character functions return a NULL if the values of any arguments passed to the functions is NULL. Which of the functions listed do not necessarily return NULL if an incoming argument is NULL?"
The first email I got on this quiz said: "While I understand the answers provided, I did have a little trouble interpreting the question - although I'm not sure how I might have worded it differently as yet. It will be interesting to see how much feedback you receive on this one."
And usually if any single player raises a concern about wording, well, there's more to come. And there was:
And now my responses:
First, regarding the semantics of the question: I suppose I could have worded this quiz differently. I believed and still believe that the text of the question is equivalent to the following:
"Is it possible to call the function so that at least one of the arguments is NULL and it returns a non-NULL value?"
That is, if one of the arguments is NULL, that does not mean that the return value of the function would have to ("necessarily") be NULL. So all you have to do is identify a scenario in which you can call the function with NULL and have it return a non-NULL value for it to be a correct choice.
I can see why there might have been confusion with the phrasing (it's sorta, kinda like a double negative because NULL is, well, not very positive). I do not, however, feel that my use of the language here is ambiguous. On to the specifics raised....
CONCAT: if one of the aarguments to CONCAT is NULL and the other is not NULL, then the value returns is not NULL.
NULLIF: Just because you can find one scenario in which a NULL argument causes an error to be raised, does not mean this choice is incorrect. You can also identify a scenario in which you do pass a NULL value and it returns a non-NULL value.
SUBSTR: you don't have to pass a value for the third parameter of SUBSTR - but that's because Oracle provides a default value for that parameter. So the question then is: what is that default value? In this case, it is not NULL, as you can see from the header of the program in the STANDARD package:
function SUBSTR(STR1 VARCHAR2 CHARACTER SET ANY_CS, POS PLS_INTEGER, LEN PLS_INTEGER := 2147483647) return VARCHAR2 CHARACTER SET STR1%CHARSET;So I have no plans to change my scoring on this quiz. Your thoughts?