My Kscope19

A little later than many post-Kscope19 blog posts (because the wife and I just had a nice relaxing vacation week right after I returned from Kscope ;-), but better late than never. A few thoughts, but for once not a lot of writing - most of this post is a video...

Kscope19 in Seattle was my 10th Kscope (all consecutive) and I had a blast as usual. Loads of great content and great fun, (more...)

Coming up: My 10th Kscope!

In June 2010 I attended ODTUG Kaleidoscope 2010 in Washington D.C. I got this T-shirt:


But I didn't get just a T-shirt, I got an awesome experience. And most importantly I got to be part of a fabulous community of friends all over the globe without whom I wouldn't be where I am today.

Being hooked from day one, I've been to each and every Kscope since - attending, speaking, ambassadoring, volunteering at all (more...)

Results of the Dev Gym SQL Championship for 2018

All the after-play checking of the results of Oracle SQL Annual Championship for 2018 is done. The awards have now been processed, and it is with great pleasure I can publish the results here to serve as an inspiration for you to trying out your own SQL knowledge at the Dev Gym.


Congratulations first and foremost to our top-ranked players:

1st Place: Stelios Vlasopoulos

2nd Place: Kรถteles Zsolt of Hungary

3rd Place: Andrey Zaytsev of (more...)

ORA-22905 when calling ODCI Table functions from PL/SQL

Back in 2015 I experimented using ODCITable* functions to dynamically parse delimited text (see blog post here.)

Now blog reader Daniel Cabanillas points out, that it raises an error when used in PL/SQL. Silly me - I had only tried it out in SQL (my favorite language) and had completely missed that it failed in PL/SQL.

Lucky for me, the classic workaround of dynamic SQL works here too ๐Ÿ˜


Look in the old blog (more...)

Participant list for Oracle Dev Gym SQL Championship 2018

2018 is over. Throughout the year people have participated in the "Select for SQL" Tournament on Oracle Dev Gym. It's time for the Top 50 to try their skills in the Annual SQL Championship!


Everybody who tried the quizzes have hopefully had fun as well as exercised SQL skills. Maybe even learned a little :-) I hope you'll all keep working your mental muscles in 2019 as well - get your friends and colleagues to (more...)

ODC Appreciation Day : The ever growing toolbox

It's ODC Appreciation Day ๐Ÿ˜ƒ !

The day initiated by Tim Hall where Oracle bloggers worldwide make a blog post to show appreciation of the Oracle Developer Community.

This year I won't dive into a specific technical thing in SQL or PL/SQL, but rather I'm appreciating how much my toolbox grows all the time with new bits coming in a steady flow.


I've met database developers that learned SQL-92 20+ years ago and still today use (more...)

Corrupting characters – How to get invalid byte values stored in strings

Having worked with Database Migration Assistant for Unicode (DMU) to convert some databases from single-byte charactersets to AL32UTF8, I had problems with DMU reporting a lot of characters with invalid byte values (in this case binary values that did not exist in WE8ISO8859P15.)

So how can that happen? Doesn't the database enforce character encoding to match the database characterset?

Wrong - not always.

Well ok, you can get invalid values with single-byte charactersets - (more...)

Announcing the results of the Oracle Dev Gym SQL Championship for 2017

A huge round of applause to the top players in the championship:

1st Place: mentzel.iudith of Israel

2nd Place: Pavel Zeman of Czech Republic

3rd Place: Andrey Zaytsev of Russia


Especially noteworthy is the accomplishment of Iudith Mentzel, who also won the DB Design Championship and has been a very regular Dev Gym participant for years. Congratulations, Iudith!



Also congratulations to everyone who played in the championship - it's quite an accomplishment to have (more...)

SQL Magic Squares – or Why the Optimizer does not like Magic

A long-time player at the Oracle Dev Gym tried his hand at generating Magic Squares using SQL.



When he attempted to tune his statement a bit, he was surprised that it didn't go a little faster as expected, rather it went from 2 minutes to 45 minutes? At that point he contacted me to see if I could explain the mystery...



So thank you, Hamid Talebian, for the interesting case. It was fun to play (more...)

Announcing participants in Oracle Dev Gym SQL Championship 2017

Another year, another Oracle Dev Gym SQL Annual Championship. Woohoo!


Players have exercised their mental muscles with the SQL puzzles throughout 2017. Congratulations to everybody digging in all year, trying to figure out the pretzelbenders of me and other quiz authors. And hopefully you've learned something as well, improving your SQL skills.

And a very special congratulations to the Top 50 in the "Select for SQL" Tournament in Oracle Dev Gym in 2017. It takes (more...)

Object type "nested" implicit grants

A colleague got an "ORA-01720: grant option does not exist" error and couldn't understand why. So together we researched a bit and learned some things about how object type grants across schemas works - including a small surprise that was the reason for our puzzlement.

To demonstrate, I create three users with just the necessary privileges:

SQL> connect system@orcl
Enter password:
Connected.
SQL> grant connect, create type to user1 identified by user1;

Grant succeeded.

SQL> (more...)

ODC Appreciation Day: Cursor Variables

You know everything is Tim Halls fault, right? Including this blog post? Oh yes it is, he came up with the idea of OTN ODC Appreciation Day - a day where Oracle Bloggers all over the world show their appreciation of the Oracle Developer Community by blogging about some favorite Oracle feature.

So what should I pick this year of the multitude of possible favorites? Something brand new? No, I think I'll write about (more...)

Avoiding reinventing the wheel – use MULTISET EXCEPT to get set relative complement

Today in an application I stumbled upon a PL/SQL function created to return those elements of one nested table that did not exist in another nested table. Not a huge function, but still a bit of work and some thinking that had been done some while ago to compare the elements and create the desired output nested table.

The trouble is, that this functionality already natively exists in PL/SQL (and SQL) - the developer had (more...)

Partitioning external tables in 12.2

One of the new features in Oracle 12.2 is partitioning of external tables - a quite useful feature if you have multiple identical files of data, for example from multiple sources.

But how can you partition external files, you ask? Well, you don't partition the files, but each file can be considered a partition by the database. I'll show you an example.

Like always, to use external tables we need a DIRECTORY and our (more...)

Collation in 12cR2 – when AA equals ร… (or not?)

Collation in Oracle 12cR2 gives some more finegrained possibilities for setting up how your data is to sorted and compared linguistically. A lot we could do before with NLS_SORT and NLS_COMP and the likes, but the collation features can both be simpler to use as well as offer more detailed control.

But do some testing for your specific language cases - you might find some small surprises like I did when trying it out with (more...)

Results of Oracle Dev Gym SQL Annual Championship for 2016

March 29th 2017 a group of 35 database developers competed in the Oracle Dev Gym SQL Annual Championship for the top ranked players of 2016. They worked their little grey cells hard for 45 minutes over 5 quizzes that I had tried to make extra hard for them.

The results have now been made public on the Oracle Dev Gym site, so I'd like here to add my congratulations to everyone who made it to (more...)

String to DATE conversion and validation in 12.2

A new little feature in Oracle Database 12.2 is, that you can convert strings to dates without worrying about exception handling. (That goes also for converting to numbers or timestamps or other datatypes, but here I'll concentrate on dates.)

It's just one of a ton of new 12.2 features ranging from minor features that make your daily life slightly easier to major inventive features. I've been part of a Trivadis Team that (more...)

Temporal validity and open/closed intervals

A short while ago I created a SQL quiz for Oracle Dev Gym (PL/SQL Challenge) demonstrating the use of temporal validity and VERSIONS PERIOD FOR syntax to create a "change report" for changes in item prices. Use of temporal validity makes this easier, shorter and more readable code, but even though I thought I had it all covered, player Iudith Mentzel pointed out a tiny quirk I'd overlooked.

You see, the "change in price" wasn't (more...)

Announcing the SQL Annual Championship for 2016

I've been making SQL quizzes for years now over at the Oracle Dev Gym (or PL/SQL Challenge as it started out as.) Every year I really have to work my few braincells hard when it is time for the annual championships. The players that have made it through at year and managed to rank in the top are awesome at SQL, so I have to write some really hard quizzes for the championship.

But (more...)

A handful of articles

A little while ago a member of the Danish Oracle User Group DOUG asked if anyone had a bit of experience with use of R together with Oracle Database. I remembered an article I wrote for OTech Magazine on forecasting with R and Oracle and thought it would be a good primer for him. OTech Magazine is no longer active, sadly, but I thought I could send him a link anyway to my article. That (more...)