26 May 2011

Should We Test Knowledge of "Bugs" in Quiz? (2344)

The 24 May demonstrates the impact of using a constrained subtype for the datatype of an associated array index, as well the fact that when using a BULK COLLECT fetch to populate that collection, the constraints of the type are ignored.

Two players complained that they don't think it makes sense for a quiz to test one's knowledge of a bug. I offer their comments below and will leave it to the author first to reply with her own "story behind the quiz", and of course publish any other comments as well.

"While this is obviously known behaviour, I feel a bit ripped off in getting this wrong. I answered what was logical (to me) from the code - the array definition says the index must be -1/0/1, bulk collect will use index values 1/2/3, so bulk collect will error. To me, the behaviour of bulk collect ignoring the index by's data type constraints seems like a bug. If this is documented by Oracle as being expected behaviour, it would be good to have that reference in the answer. If not, it seems a bit rough to mark people incorrect for not knowing about a bug."

and with some code, too:

When you run the code of this quiz, Oracle does actually make from an INDEX BY SIGNTYPE table an 'read-only' INDEX BY PLS_INTEGR table. You can only change the values for index (-1, 0, 1). See the following code:
DECLARE
   TYPE t_bug_type IS TABLE OF all_source%ROWTYPE
                         INDEX BY SIGNTYPE;

   v_bugs   t_bug_type;

   v_ndx    PLS_INTEGER;
BEGIN
   BEGIN
        SELECT *
          BULK COLLECT INTO v_bugs
          FROM all_source
      ORDER BY owner, name, line;
   EXCEPTION
      WHEN OTHERS
      THEN
         DBMS_OUTPUT.put_line ('ERROR');
   END;

   DBMS_OUTPUT.put_line (
         'First = '
      || v_bugs.FIRST
      || ' Last = '
      || v_bugs.LAST
      || ' Count = '
      || v_bugs.COUNT);

   v_ndx := v_bugs.FIRST;

   DBMS_OUTPUT.put_line (v_bugs (v_ndx).text);

   v_ndx := v_bugs.LAST;

   DBMS_OUTPUT.put_line (v_bugs (v_ndx).text);

   BEGIN
      v_bugs (v_bugs.LAST).text := 'Oracle has many bugs !!';
   EXCEPTION
      WHEN OTHERS
      THEN
         DBMS_OUTPUT.put_line (
            'You should not create quizzes based on bugs !!');
   END;
END;
/
Oracle has many bugs, in my opinion it is not intended to make quizzes based on bugs.

So...what do you think?

23 May 2011

PL/SQL Challenge Version 2 Now Available!

Version 2 of the PL/SQL Challenge is a major upgrade of this popular site for Oracle technologists. We've been developing version 2 for over six months (where did all that time go?) and we are extremely pleased with the results. I hope you will feel the same way.

There are many changes to the site, highlights of which I offer below:
  • New and improved interface: earlier versions of the website were very text-heavy, with minimal use of color and images. We believe that the new site will be easier and more enjoyable to use.
  • More flexible architecture and offering of quizzes: PL/SQL Challenge V1.X was built completely around the daily PL/SQL quiz. This approach wasn't really flexible enough to handle existing requirements (such as the monthly Toadworld quiz and the quarterly playoff), and it certainly wouldn't let us easily add other kinds of quizzes on other technology areas. V2 puts in place a platform that not only offers more flexibility and clarity today, but will make it easy to add more quizzes in the (near) future.
  • Guest-related features: now, even before you register, you can check out up to five quizzes in the library and play a sample quiz. We hope this will make the site more welcoming and encourage more technologists to play. If you visit the site and you are not yet logged in, you will now see a Welcome page that offers these features to guests
  • New messages system: no more ticker across the page, we now offer a separate tab on the menu, Messages, in which you can view both news, broadcast to all players, and personal messages, directed specifically to you. When you have unread messages, the Message button will blink.
  • On-line reviewing: now both reviewers and quiz authors can review, comment on, and edit questions. This will make it easier for the broader player community to help build and quality-check the quizzes.
  • Polls: you can, right within the website, take polls to help us enhance the PL/SQL Challenge experience for all players. Polls are built on the same foundation as quizzes, so it was a nice verification of the generalized platform we built. We hope that you take the time to take those polls and make a difference at the PL/SQL Challenge!
  • Behind the scenes: as much as the player-facing pages of the PL/SQL Challenge website has changed, the "backend" component of the application has also been transformed. We are now automating many more of the tasks required to operate the PL/SQL Challenge. This will make us more efficient and responsive.

The website is very different, offering more features, but hopefully in an intuitive fashion. We plan to  record videos exploring these new features; we'll let you know when they are available.

Our deepest gratitude to the many Challenge players who participated in the beta and final test phases of our development. Your feedback, critiques and suggestions have resulted in major improvements to the site. And, of course, we welcome all of your comments now that the site is live.

I will, by the way, also shortly announce the date for the Q1 2011 playoff, which I have put off until this new architecture is in place. We did a "test" playoff last week, and the feedback from players on the improved usability was very positive.

So...we hope that you enjoy the new website, and wish you the best as you play the PL/SQL Challenge!

For the PL/SQL Challenge development team,
Steven Feuerstein