15 September 2010

14 September quiz: What about the extra line in FORMAT_ERROR_STACK? (1382)

The 14 September quiz asked: Which of the following blocks display (without the quotation marks) "ORA-20000: Balance too low!"? Several players wrote to remind me "None of the answers will display JUST the indicated message since there will be an extra CR/LF at the end (one for FORMAT_ERROR_STACK and one for PUT_LINE)." I agree and hopefully we can all agree: the DBMS_UTILITY.FORMAT_ERROR_STACK function returns the error stack, plus an additional line feed character. And if I had asked "Which of the blocks display absolutely nothing more than "ORA-20000: Balance too low!" then I suppose I would have to score all choices as wrong. Since I only asked which would show that string (and not just that string), though, I believe the scoring is correct. And I sure hope that going forward I will write my questions and choices so that this additional character will never play a role in determining whether a choice is correct or incorrect. Cheers, Steven

2 comments:

  1. If it wasn't for that quiz a week or two ago where someone commented on the CR/LF, how many would actually have known? I for sure didn't and I am also not losing sleep over it ;-)

    For the sake of accuracy "plus an additional line feed character" is actually two characters in Windows: ASCII 13,10 and a single character ASCII 10 in UNIX. (Can't believe I'm actually writing this ;-)

    I just hope such "discoveries" or "copycats thereof" will not develop into a challenge of its own.

    ReplyDelete
  2. Oddly enough, Mike, Oracle adds JUST a line feed character to the string. Not TWO characters. And this was in Windows.

    ReplyDelete