Category Archives: SQL

Numeric sorting an alphanumeric column

The other day a customer came up to me and said: I have this column that holds numeric data, usually. But when I sort it it gets all messed up, because is sorts it alphanumerically. That is 10 is listed before 2 etc. My first suggestion was: well, sort by TO_NUMBER(column) then. Well, he replied, […]

Read more

Is it unique?

The other day one of my colleagues said something like: ‘Hey, this is strange. Oracle is not working correctly’. My first thought is then: ‘well, you probably didn’t specify you requirements correctly’. What was the problem? A unique index was created on a table to implement a business rule which can be rephrased into ‘One-Manager-Per-Department’. […]

Read more

Some things to share…

I have been awfully quiet on my blog lately. I think that is because I have been busy with other things, like my garden and stuff like that. There are some ‘techie’ thing I have done in the meantime, though, I have submitted a couple of abstracts for Tech14. Hope at least one of them […]

Read more

PL/SQL vs SQL

There is a ‘rule’, I think it was created by Tom Kyte, stating: If you can do it in SQL, do it in SQL. I came across some code the other day that makes perfect sense to do then you are running an Oracle 10g (or earlier) instance. I rewrote the code to use only […]

Read more

KScope14

This year, from June 22 – June 26, the best convention in the world, ODTUG‘s KScope14 will be held in Seattle, Washington. I am already looking forward to meeting some ‘old’ friends again, creating new friends and seeing some of the best content by presenters from all over the world. Some of the presentations I […]

Read more

Finding wildcards

We sometimes use wildcard characters in the values of our columns. This makes it hard to find just these records. When looking for these records you want to search for the wildcard character, but this will return the other records as well.

Read more

Case-Insensitive…

When building your queries you might want to search case-insensitive. We normally use the UPPER() function to accomplish this. This is kind of weird IMHO, because you have to uppercase the value you are looking for. I was wondering why we are not using the LOWER() function. I put this question on Twitter the other […]

Read more

Using External Tables…

I have been appointed Track Leader for the Developer’s Toolkit for KScope13. This involves voting on abstracts. Everyone in the group should rate the abstracts on a scale of 1 to 5. Where 1 is not good (Not appropriate…) and 5 is very good (Highlight of the conference…). After all the members of the group […]

Read more