10 October 2012

Time for the Q3 2012 Championship Playoff!

The following players will be invited to participate in the Q3 2012 championship playoff. The number in parentheses after their names are the number of playoffs in which they have already participated.

It's very impressive to see the #1 rank taken by a player who has participated in just one previous playoff.  Six players have never been in a playoff before - it's always good to have "new blood" giving those repeat players a run for their money.

See the FAQ for an explanation of the three ways a player can qualify for the playoff. And congratulations to all listed below on their accomplishment and best of luck in the upcoming competition!

We will set and publish the date of the playoff very soon.

Name Rank Qualification Country
swart260 (1)1Top 25Netherlands
Sean Stuber (5)2Top 25United States
Jerry Bull (5)3Top 25United States
Stelios Vlasopoulos (4)4Top 25Belgium
mentzel.iudith (7)5Top 25Israel
Vinu (1)6Top 25India
Chad Lee (5)7Top 25United States
Viacheslav Stepanov (6)8Top 25Russia
Randy Gettman (7)9Top 25United States
Marco Siefert (1)10Top 25Germany
Frank Schrader (8)11Top 25Germany
Siim Kask (7)12Top 25Estonia
Yuan Tschang (4)13Top 25United States
kowido (6)14Top 25No Country Set
Justin Cave (6)15Top 25United States
Niels Hecker (8)16Top 25Germany
Anna Onishchuk (6)17Top 25Ireland
Frank Schmitt (2)18Top 25Germany
Jeroen Rutte (1)19Top 25Netherlands
Chris Saxon (3)20Top 25United Kingdom
Zoltan Fulop (2)21Top 25Hungary
Giedrius Deveikis (1)22Top 25Lithuania
koko (0)23Top 25Ukraine
Sebastian Kolski (2)24Top 25Poland
Kim Berg Hansen (3)25Top 25Denmark
Janis Baiza (4)27WildcardLatvia
Markus Langlotz (1)29WildcardSwitzerland
Ivan Blanarik (2)30WildcardSlovakia
Jens Petersen (1)34WildcardGermany
Tony Winn (1)35WildcardAustralia
Patrick Barel (0)37WildcardNetherlands
Jason H (0)46WildcardUnited States
Goran Stefanović (2)50CorrectnessSerbia
Michal Cvan (5)57CorrectnessSlovakia
Gary Myers (4)68WildcardAustralia
Mike Pargeter (7)69CorrectnessUnited Kingdom
puchtec (0)78WildcardGermany
Peter Schmidt (2)80WildcardGermany
macabre (2)87CorrectnessRussia
Vijay Mahawar (0)99CorrectnessIndia
Tobias Stark (1)140CorrectnessGermany
Karel Prech (0)166CorrectnessCzech Republic
mark kavalaris (0)274CorrectnessNo Country Set
Dan Kiser (1)308CorrectnessUnited States
Fernando Bautista (0)464CorrectnessUnited Kingdom

01 October 2012

Should PL/SQL Developers Care About "Internals"?

We've posted a new Roundtable discussion with the title

Should PL/SQL Developers Care About "Internals"? 

This discussion point was provided Jeff Kemp, a long-time player of the PL/SQL Challenge who writes:

Our esteemed colleague Steven once wrote: "...regarding the question of "internal" storage: I have no idea how Oracle manages these structures. ... why should we care? We just need to know that we can use the data structures with confidence (no or minimal bugs, good performance). Why get caught up with 'internal' details that can change from version to version anyway?" Do you agree?

I encourage you to visit the Roundtable discussion page, read Jeff's full presentation, and add your thoughts.

20 September 2012

PL/SQL Challenge Adds New Feature: Favorites

We upgraded to version 2.4 today and it has a single new feature - requested by many players: Favorites.

You can now "tag" authors, players, quizzes, resources, features and more as Favorites. The home page will then show latest news about your favorites and - if you are receiving emails with quiz results - you will be notified via a daily email digest of this news as well.

You will now see "Add to Favorites" links on the Quiz Details page, a player's profile, and more. Just look for this widget:


and click on it to add to your favorites, after which it will look like this:

 
You will now find on your home page a new section showing the latest news for your Favorites:




The Favorites tab on the menu offers access to the Favorites Manager page, where you can remove favorited items and also "zoom" straight to an item of interest.


And the Favorites Manager:
Notice that you can request to have a daily digest emailed to you with the latest news for your Favorites. We have turned on this preference only if you are already receiving daily emails with quiz results.

We hope you like this feature and take full advantage of it. Please let us know if you see any ways we can improve it.

Warm regards and happy playing,
Steven Feuerstein

18 September 2012

September Update at the PL/SQL Challenge

[Find below the text of the September 2012 e-newsletter sent out to PL/SQL Challenge subscribers.]

Another summer gone...and a hot one it was. Let's just hope the ice in the Arctic circle returns next year. In the meantime, eyes turn towards Oracle Open World, the annual extravaganza of All Things Oracle (and that is an awful lot of "things", compared to the old days).

I'll be presenting twice on Wednesday, 3 October, and I will have more PL/SQL Challenge ribbons. So I hope to see many Challengers there and ready to add that ribbon to their conference badge!
Speaking of the old days, the 2012 OOW will be my twentieth consecutive presenting at OOW or IOUW (International Oracle User Week, the precursor to OOW that was organized by the International Oracle User Group). I just came across the acceptance letter for my 1992 submission: "An Interactive Debugger for SQL*Forms." Yes, that's right. A debugger for SQL*Forms 3.0, which I built in SQL*Forms itself. I called it XRay Vision and it was a very cool utility - and a testimony to the foolishness of building tools for products at the end of their lifecycle. I didn't sell too many copies of XRay Vision. Sigh...

We've now passed 550,000 answers submitted to quizzes since April 2012 - the PL/SQL Challenge is still going strong and making Oracle technologists around the world stronger PL/SQL developers. If you haven't been playing lately (or taking advantage of our Practice feature - more on that below), I encourage you to pay us a visit.

Dynamic SQL: Never use to avoid code repetition?

The 12 September 2012 PL/SQL quiz asked players to pick the choice that would allow a developer to add an entirely new table to the application schema, and not have to change the procedure that will be used to insert into this table. This is accomplished through the use of dynamic SQL, and several players objected to the use of dynamic SQL in this kind of situation. This quiz was drawn from our own experience at the PL/SQL Challenge. We are implementing support for Favorites and we have at this point seven "kinds" of favorites: quiz, author, player, roundtable discussion, quiz commentary, resource, feature. We have a distinct table for each kind of favorite, whose names follow the convention "qdb_fav_[type]s", as in qdb_fav_authors and qdb_fav_players.

I really like to minimize code volume and strip out any repetition, so I chose this dynamic SQL approach to inserting a now into the appropriate favorites table:
PROCEDURE add_favorite_dynamic (user_id_in         IN INTEGER,
                                favorite_id_in     IN INTEGER,
                                favorite_type_in   IN VARCHAR2)
IS
BEGIN
   EXECUTE IMMEDIATE
         'INSERT INTO qdb_fav_'
      || favorite_type_in
      || 's (user_id, '
      || favorite_type_in
      || '_id, notify_user) VALUES (:user_id, :favorite_id)'
      USING user_id_in, favorite_id_in;
END add_favorite_dynamic;
Notice that even if we start keeping track of another kind of favorite, this procedure would not have to be modified, as long at the naming conventions are followed when creating the new table.
If I were to use static SQL, my procedure would look like the one below, and would have to be changed each time we add a new favorites table:
PROCEDURE add_favorite_static (user_id_in         IN INTEGER,
                               favorite_id_in     IN INTEGER,
                               favorite_type_in   IN VARCHAR2)
IS
BEGIN
   CASE favorite_type_in
      WHEN c_fav_author
      THEN
         INSERT INTO qdb_fav_authors (user_id, author_id)
              VALUES (user_id_in, favorite_id_in);
      WHEN c_fav_comp_event
      THEN
         INSERT INTO qdb_fav_comp_events (user_id, comp_event_id)
              VALUES (user_id_in, favorite_id_in);
      WHEN c_fav_discussion
      THEN
         INSERT INTO qdb_fav_discussions (user_id, discussion_id)
              VALUES (user_id_in, favorite_id_in);
      WHEN c_fav_player
      THEN
         INSERT INTO qdb_fav_players (user_id, player_id)
              VALUES (user_id_in, favorite_id_in);
      WHEN c_fav_question
      THEN
         INSERT INTO qdb_fav_questions (user_id, question_id)
              VALUES (user_id_in, favorite_id_in);
      WHEN c_fav_resource
      THEN
         INSERT INTO qdb_fav_resources (user_id, resource_id)
              VALUES (user_id_in, favorite_id_in);
      WHEN c_fav_thread
      THEN
         INSERT INTO qdb_fav_threads (user_id, thread_id)
              VALUES (user_id_in, favorite_id_in);
      WHEN c_fav_topic
      THEN
         INSERT INTO qdb_fav_topics (user_id, topic_id)
              VALUES (user_id_in, favorite_id_in);
   END CASE;
END add_favorite_static;
Another static SQL approach: rather than having a distinct table for kind of favorite, use a single favorites table (and thereby lose the ability to define a foreign key on the "favorite ID" column):
PROCEDURE add_favorite_static (
   user_id_in         IN INTEGER,
   favorite_id_in     IN INTEGER,
   favorite_type_in   IN VARCHAR2)
IS
BEGIN
   INSERT
     INTO qdb_favorites (user_id, favorite_type, favorite_id)
   VALUES (user_id_in, favorite_type_in, favorite_id_in);
END add_favorite_static;
Which approach would you take? We've set up a poll to get your feedback on this issue. I hope you can take a few minutes from your busy schedule to "vote".

Practice Makes Expert!

Did you know that in addition to taking daily, weekly and monthly scheduled quizzes, you can also (re)take any past quizzes through the PL/SQL Challenge Practice feature?

Click on the Practice tab on the menu and you can then set up a practice based on particular features of the technology you'd like to get more familiar with or for quizzes drawn from favorite authors. You can also take advantage of the Autotune feature: the PL/SQL Challenge will automatically add practices to your queue based on either past low scores or missed quizzes - you decide how many of and how often these practices should be generated.

Since we added the Practice feature to the PL/SQL Challenge in April 2012, nearly 450 Oracle technologists have completed over 2100 practice quizzes. One player has taken 130 practice quizzes, and another twenty players have taken at least 25 quizzes each.

Here's what one player, Ruslan, told us about how he uses this feature:

"I like to practice my PL/SQL on PL/SQL Challenge because I can hone my knowledge in a wide range of themes and on different levels. Constant practicing helps me to solve my tasks much better and more effective and to prepare to be certified. For example when I started one of my first projects I knew nothing about BULK operations and Dynamic SQL and packages that hold constants. So I developed not really flexible and fast application. After I learned all of that here I rewrite that application and made it more general and fast enough. The PL/SQL Challenge site is very ergonomic. I like the Library because it helps me to get back to my mistakes and learn what I didn't know previously. And I like statistics. Statistics shows my progress in time. Thank you for such a great place to learn PL/SQL!"
 
You, too, can use the PL/SQL Challenge site to learn more about PL/SQL (and SQL and APEX....) and solve problems faster. Set up your Autotune practices today and start down the path to PL/SQL expertise!

New Poll: Usability of the PL/SQL Challenge website

An on-again, off-again player of the PL/SQL Challenge wrote the following to us:

"I tried to find how to play the PL/SQL quiz and just couldn't find where to go to play the PL/SQL quiz which I've played on and off for a few years now. The web pages have become so complicated that you seem to have to go through several rules and pages to get to the quiz. Could you tell me where I go to play the quiz? I learnt a lot from playing this quiz but now am thinking of stopping because it's taking too long to get to it. Don't get me wrong - I think it's a brilliant idea and so good for keeping on top of PL/SQL changes. I wish the web pages were simpler."
 
We were surprised - and dismayed - to hear this; we didn't think it was hard to play a quiz on the site. If it is, well, that is something we need to fix, and fast.

So we thought we'd ask our players for some feedback on usability of the site. Please take a moment to help us improve your experience at the PL/SQL Challenge.

High Performance PL/SQL Video

On 5 September, Quest Software hosted a webinar by yours truly on Higher Performance PL/SQL. It was just an hour long, so I had to focus very closely on just a few topics: BULK COLLECT, FORALL, Function Result Cache, NOCOPY and - barely squeezed in - pipelined table functions. You can watch the recorded session here . Enjoy!

28 August 2012

Roundtable Discussion: Identifier Naming Conventions

Our second Roundtable discussion focuses on an issue that every developer grapples with: how to name our identifiers. That is, what are our naming conventions?

There have been many approaches to creating names, including CamelCase and Hungarian notation.

A longtime PL/SQL Challenge player, John Hall, offers a very different approach:

Identifiers can be considered a form of documentation, which raises the question, "What should an identifier's name document?"I propose this core principle: "Identifier names are based solely on the problem domain concept." No prefixes for scope. No suffixes for type.

In other words, while I would usually write a block of code like this:

DECLARE
   TYPE employees_t IS TABLE OF employees%ROWTYPE;
   l_employees   employees_t;
BEGIN
   SELECT *
     BULK COLLECT INTO l_employees
     FROM employees;
END;

John would, instead, do the following:

DECLARE
   TYPE employee_table IS TABLE OF employees%ROWTYPE;

   all_employees   employee_table;
BEGIN
   SELECT *
     BULK COLLECT INTO all_employees
     FROM employees;
END;

He's already got me thinking differently about how to write my code, though I am not yet ready to force my fingertips into drastically different patterns of typing.

I encourage you to visit the Roundtable, check out the discussion, and add your own thoughts.

11 August 2012

PL/SQL Challenge Upgraded to Release 2.3

The PL/SQL Challenge development team just completed a smooth upgrade of the site to release 2.3. Key features of this version include:

New Roundtable Discussion 

You can now participate in "roundtable" discussions of big-picture issues or questions that do not necessarily fit within the scope of a single quiz. We will use this feature to gather use cases for seldom-used features of PL/SQL, such as invoker rights, and also seek consensus on overall strategies for optimal PL/SQL development, such as exception handling. 

Fine-Grained "Rank Me" 

Prior to 2.3, when you chose to play for educational purposes only, this status applied to all quizzes and any rankings you'd accumulated disappeared. You also could not "revert" back to competitive status except during the first week of a quarter. Clearly, not ideal. You can now choose to compete (be ranked) or play for educational purposes only on a quiz-by-quiz basis. You can change this status at any time. And for all the times you played competitively, your ranking will still be visible and available.

Resource Library

When you visit the Quiz Library you will now see two tabs: Quizzes and Resources. Quizzes contains the "usual" library report: all past quizzes of the PL/SQL Challenge. The Resources tab now gives you quick, searchable access to the many resources we've been attaching to our Knowledge Tree on the PL/SQL, SQL and APEX. Most of these resources are links to Oracle documentation, but there are also plenty of links to great blog posts and Ask Tom answers, as well as a growing number of PL/SQL scripts.

Next time you need to check the Oracle documentation on a PL/SQL topic, you might find it faster and easier through the Resources Library.

You can also submit your own ideas for resources to add to our library.

Many thanks to Eli Feuerstein, who implemented these new features in APEX.

31 July 2012

Results from Q2 2012 Championship Playoff

You will find below the rankings for the Q2 2012 playoff; the number next to the player's name is the number of times that player has participated in a playoff.

Congratulations first and foremost to our top-ranked players:

1st Place: kowido wins Amazon.com US$250 Gift Card .
2nd Place: Justin Cave of United States wins Amazon.com US$175 Gift Card.
3rd Place: Frank Schrader of Germany wins Amazon.com US$100 Gift Card

In the Q1 2012 playoff, the highest % correct was 87. In this playoff, five players exceeded 90% accuracy, with our second-place winner actually getting every single choice correct! Nice work, Justin. You might then be asking yourself: "Why is Justin in second place if he got every choice correct?" That's because kowido, the first-place winner, was almost as correct (only 2 wrong out of 23 choices - a performance matched by three others) and he submitted his answers in about half the time of Justin.

Sometimes it pays to hurry - at least if you really know your stuff. And as you can see from the table below, kowido squeaked into first place with just one more point than Justin.

Congratulations to everyone who played in the playoff. I hope you found it entertaining, challenging and educational. And for those who were not able to participate in the playoff, you can take the quizzes next week through the Practice feature.

Steven Feuerstein

PS - Below the table of results for this playoff, you will find another list showing the playoff history of each of these players.

Playoff Results 


Rank Name Country Total Time % Correct Total Score
1kowido (6)No Country Set16 mins 04 secs91%2879
2Justin Cave (6)United States31 mins 06 secs100%2878
3Frank Schrader (8)Germany19 mins 27 secs91%2811
4Frank Schmitt (2)Germany15 mins 06 secs87%2748
5Niels Hecker (8)Germany30 mins 42 secs91%2586
6Siim Kask (7)Estonia25 mins 58 secs87%2531
7Giedrius Deveikis (1)Lithuania17 mins 21 secs83%2518
8Dieter Kowalski (2)Germany27 mins 16 secs87%2470
9Sean Stuber (5)United States34 mins 57 secs91%2466
10Scott Wesley (2)Australia15 mins 15 secs78%2410
11Anna Onishchuk (6)Ireland33 mins 52 secs87%2373
12Viacheslav Stepanov (6)Russia32 mins 38 secs87%2362
13Rakesh Dadhich (1)India17 mins 34 secs74%2324
14Jerry Bull (5)United States23 mins 49 secs78%2324
15Ivan Blanarik (2)Slovakia34 mins 56 secs87%2316
16Vincent Malgrat (3)French Republic25 mins 48 secs83%2274
17Sebastian Kolski (2)Poland30 mins 18 secs83%2259
18james su (5)Canada24 mins 36 secs74%2098
19mentzel.iudith (7)Israel34 mins 52 secs78%2018
20Mike Pargeter (7)United Kingdom20 mins 03 secs70%2014
21Kuzmin Konstanin (1)No Country Set16 mins 59 secs70%2000
22Randy Gettman (7)United States29 mins 30 secs74%1935
23_tiki_4_ (3)Germany24 mins 23 secs70%1887
24swart260 (1)Netherlands19 mins 26 secs65%1876
25Kevan Gelling (6)Isle of Man31 mins 01 secs70%1870
26Chad Lee (5)United States34 mins 28 secs74%1861
27Yuan Tschang (4)United States34 mins 55 secs74%1827
28Syed Ariful Bari (4)Bangladesh08 mins 05 secs57%1778
29Zoltan Fulop (2)Hungary32 mins 43 secs65%1671
30Goran Stefanović (2)Serbia34 mins 46 secs65%1620
31Anil Jha (1)United States26 mins 18 secs57%1389
32Vinu (1)India29 mins 38 secs48%1072
33Stelios Vlasopoulos (4)Belgium29 mins 57 secs48%1041

Playoff Performance History 

After each name, the quarter in which he or she played, and the ranking in that playoff.

Name History
kowidoQ1 2011:25th, Q2 2011:9th, Q3 2011:16th, Q4 2011:20th, Q1 2012:4th, Q2 2012:1st
Justin CaveQ3 2010:26th, Q4 2010:3rd, Q1 2011:5th, Q3 2011:3rd, Q1 2012:25th, Q2 2012:2nd
Frank SchraderQ3 2010:12th, Q4 2010:30th, Q1 2011:1st, Q2 2011:5th, Q3 2011:1st, Q4 2011:1st, Q1 2012:13th, Q2 2012:3rd
Frank SchmittQ4 2011:23rd, Q2 2012:4th
Niels HeckerQ2 2010:2nd, Q3 2010:1st, Q4 2010:15th, Q1 2011:7th, Q3 2011:7th, Q4 2011:10th, Q1 2012:2nd, Q2 2012:5th
Siim KaskQ1 2011:29th, Q2 2011:7th, Q3 2011:10th, Q4 2011:3rd, Q1 2012:9th, Q2 2012:6th
Giedrius DeveikisQ2 2012:7th
Dieter KowalskiQ1 2012:21st, Q2 2012:8th
Sean StuberQ3 2010:5th, Q1 2011:21st, Q2 2011:11th, Q1 2012:16th, Q2 2012:9th
Scott WesleyQ3 2010:30th, Q2 2012:10th
Anna OnishchukQ1 2011:6th, Q2 2011:22nd, Q3 2011:20th, Q4 2011:17th, Q1 2012:24th, Q2 2012:11th
Viacheslav StepanovQ1 2011:9th, Q2 2011:4th, Q3 2011:13th, Q4 2011:19th, Q1 2012:19th, Q2 2012:12th
Rakesh DadhichQ2 2012:13th
Jerry BullQ2 2011:33rd, Q3 2011:8th, Q1 2012:14th, Q2 2012:14th
Ivan Blanarik Q1 2012:3rd, Q2 2012:15th
Vincent MalgratQ4 2011:9th, Q1 2012:15th, Q2 2012:16th
Sebastian KolskiQ1 2012:22nd, Q2 2012:17th
james suQ3 2010:56th, Q2 2011:8th, Q3 2011:11th, Q4 2011:14th, Q2 2012:18th
mentzel.iudithQ4 2010:4th, Q1 2011:17th, Q2 2011:24th, Q3 2011:5th, Q4 2011:4th, Q1 2012:8th, Q2 2012:19th
Mike PargeterQ4 2010:22nd, Q1 2011:15th, Q2 2011:10th, Q4 2011:5th, Q1 2012:6th, Q2 2012:20th
Kuzmin KonstaninQ2 2012:21st
Randy GettmanQ3 2010:8th, Q1 2011:26th, Q2 2011:12th, Q3 2011:4th, Q4 2011:11th, Q1 2012:20th, Q2 2012:22nd
_tiki_4_Q4 2011:27th, Q1 2012:18th, Q2 2012:23rd
swart260Q2 2012:24th
Kevan GellingQ2 2011:21st, Q3 2011:2nd, Q4 2011:6th, Q1 2012:7th, Q2 2012:25th
Chad LeeQ2 2011:27th, Q3 2011:18th, Q4 2011:12th, Q1 2012:1st, Q2 2012:26th
Yuan TschangQ2 2012:27th
Syed Ariful BariQ3 2011:19th, Q4 2011:28th, Q1 2012:32nd, Q2 2012:28th
Zoltan FulopQ1 2012:17th, Q2 2012:29th
Goran StefanovićQ1 2012:34th, Q2 2012:30th
Anil JhaQ2 2012:31st
VinuQ2 2012:32nd
Stelios VlasopoulosQ4 2010:38th, Q4 2011:21st, Q1 2012:30th, Q2 2012:33rd