Tuesday, June 24, 2014

My Early Departure From Kscope 14

Unfortunately I had to cut my Kscope 14 trip short. I had hit my head pretty hard right before leaving for Kscope and it turns out I gave myself a "mild" concussion. I'm not sure why they call it mild since it really threw me off.

If you've ever had a concussion before then you'll know what I'm going through. The only way to recover is to rest in a quite location for as long as it takes. I had hoped for a speedy recovery but that just isn't going to be the case for me.

I want to thank everyone for coming to Kscope 14 and I hope you enjoy your time at the conference. For those looking to attend my presentations, I sincerely apologize for cancelling at the last minute. I will try to do a webinar on Logger when I'm feeling better and time permits.

See everyone at Kscope 15!

- Martin

Thanks to all those that have sent me messages. I need to keep my screen time to a minimal and will reply later on.

Saturday, June 21, 2014


In January the ODTUG board had a meeting. During the trip I took some time to explore Seattle, the hotel, and conference centre. Here's a summary of the tweets that I sent out. If you're in Seattle and looking for things to do this should help.

Monday, June 16, 2014

Presenting at ODTUG Kscope 14

I'll be heading to Seattle soon for ODTUG Kscope 14 which officially kicks off on Sunday, June 22nd. Kscope is the premier Oracle developer conference with experts flying in from around the world to participate in a week lot of excellent talks and great networking opportunities.

I will be giving the following presentations on APEX and PL/SQL / at these events this year.

Lunch with Oracle ACEs

When: Mon Jun 23, 2014, 11:15 - 1:00 pm

It’s your chance to meet the ACE Directors and ACEs up close and personal. They will be sitting at tables designated with topics of their expertise. Feel free to join one of those tables for lunch to ask technical questions or just to meet and talk with these Oracle user legends.

Just for the record, I didn't come up with description ;-). Essentially most of the ACEs (ACE Directors, ACEs, and ACE Associates) will be sitting at different tables in the lunch area and you can sit at their table. If you have questions for a specific person bring them and ask them. If you read this blog then you know I'm good for any APEX, PL/SQL, SQL, and Web questions in general. Of course I'm always open to talk about anything else!

Just Log It.

When: Mon Jun 23, 2014, Session 2, 1:15 pm - 2:15 pm
Room: 607

Abstract: Code instrumentation is critical in helping developers debug applications. This presentation will cover Logger, which is an open-source PL/SQL logging tool used in many organizations. The latest features of Logger will be discussed, along with integration into APEX and how to take proactive approaches to error handling in your applications.

This talk will cover the open source PL/SQL logging tool: Logger. I'll also be covering some of the new features that are being actively worked on.


Note: this was supposed to be a talk on APEX 5.0 and had to be changed due to some scheduling conflicts. If you were hoping to see the APEX 5.0 talk I encourage you to go to Dietmar Aust's presentation on Tues at 2:00 pm in room 303.

When: Tues Jun 24, 2014, Session 7, 11:15 am - 12:15 pm
Room: 612

Abstract: This presentation will cover some of the new HTML 5 features and how to integrate them in APEX. HTML 5 is the next major version for HTML. It consists of many new features, which will make developer's jobs a lot easier and improve end-user experience. This presentation will highlight some of these new features and demonstrate how to leverage them within an APEX application. New features include (but not limited to) drag & drop, media, storage, and graphics.

I have given several HTML 5 talks at Kscope before and they have all covered new features. This is no different as it will cover some really cool new features in HTML and show how you can add them to your APEX applications.

Oracle APEX Lunch and Learn (sponsored by OTN)

When: Tues Jun 24, 2014, 12:15-1:45pm
Room 619/620

Time to bring your Oracle APEX questions for this session as it's a free for all Q&A with fellow Oracle ACE Directors Scott Spendolini, Dimitri Gielis, Roel Hartman, Peter Raganitsch.

Thursday, June 12, 2014


Back in January we had an ODTUG board meeting in Seattle at the same location of Kscope 14. Instead of taking a taxi to the hotel, I decided to use the train that brings you 1 block away from the hotel and I'm glad I did! It only cost me $1.75 USD and I avoided all the traffic.

I tweeted my experience on getting from the Airport directly to the Sheraton hotel. For those going to KScope next weekend I hope you find these instructions helpful.

Saturday, April 12, 2014


Rick Cale recently asked a question on an article I wrote two years ago about Some Interesting Oracle Analytic Functions. His question (see comments on Apr 11, 2014) were about the results from the NTILE function and how the same value could be in two different buckets. It was an excellent question and one that got me digging a bit more into the functionality of NTILE.

They're two ways to handle "bucketing data" in Oracle. In the documentation Oracle describes the two types as either having equiwidth or or equiheight histograms.

Equiwidth (NTILE): Each bucket will have the same number of items in it with some buckets having at most 1 more item than other buckets. An easy way to think of this concept is to order all the items, then divide the data evenly into groups based on the number of buckets. For example, supposed you have 9 values (AAAABCDEF) and wanted to put them into 3 buckets. the buckets would be B1 = AAA, B2 = ABC, B3 = DEF. You'll notice that the value "A" is in both buckets B1 and B2.

When an uneven amount of objects need to go into the buckets, NTILE will fill the first bucket first, second bucket second, etc. For example, suppose you had 10 values (AAAABCDEFG) and wanted to fill them into 3 buckets. (Note this is similar to the previous example with an additional "G"). The buckets would be B1 = AAAA, B2 = BCD, B3 = EFG.

Equiheight (WIDTH_BUCKET): This will take the min and max range, divided by the number of buckets and place each value in it. For example, the salaries in the EMP table range from 801 ~ 5000. If you set the min/max range from 0~5000 3 buckets will be created. All values from 0~1,666 will go into B1, values from 1,6667~3333 into B2, and values 3334 to 5000 into B3. (Note: for simplicity I took out decimals in this split). 

An easy way to think of these two bucketing methods is that NTILE divides values based on the number of items. WIDTH_BUCKET divides values based on their values.

Here's an example that highlights the difference between the two functions. 
with data as (
  -- using this as data input
  select 3 as num_buckets
  from dual
  ntile (data.num_buckets) over (order by sal asc) ntile,
  width_bucket(sal, 0, max(sal+1) over (), data.num_buckets) width_bucket
from emp e, dept d, data
where e.deptno = d.deptno
order by sal;

DNAME          ENAME      SAL        NTILE      WIDTH_BUCKET
-------------- ---------- ---------- ---------- ------------
RESEARCH       SMITH         801          1        1
SALES          JAMES         950          1        1
RESEARCH       ADAMS        1100          1        1
SALES          WARD         1250          1        1
SALES          MARTIN       1250          1        1
ACCOUNTING     MILLER       1300          2        1
SALES          TURNER       1500          2        1
SALES          ALLEN        1600          2        1
ACCOUNTING     CLARK        2450          2        2
RESEARCH       JONES        2975          2        2
RESEARCH       SCOTT        3000          3        2
RESEARCH       FORD         3000          3        2
SALES          BLAKE        3850          3        3
ACCOUNTING     KING         5000          3        3
It's important to note that WIDTH_BUCKET is not an analytic function but NTILE is. For more information read the documentation for each function. For WIDTH_BUCKET, the documentation covers what happens with values outside the min/max range (they go into bucket 0 and num_buckets+1).