Better At Oracle

A collection of tutorials, code and tools to help you get better using Oracle

14 July 2011

The most common things done wrong

Everyone who is an Oracle expert was a beginner once, and many people seem to make the same mistakes as they are learning. This is a collection of posts about things commonly done wrong so you don't have to learn things the hard way.

Needless selects from DUAL

Of all the things I have seen done wrong over the years, selecting functions needlessly from DUAL is probably the most frequent.

Limiting query results - Top n and Window Queries

How do I find the 10 newest rows - this question seems to come up time and time again, and as far as I can tell, just about everyone implements it wrong when they first start out.

Where are the DDL and Build Scripts?

Just losing one days work for a team is much more painful than coding and versioning DDL migration scripts, and if done carefully there are powerful side effects, such as selectively removing parts of a release, developer sandboxes and eventually continuous integration, automated testing and all that other good stuff the rest of the software development world enjoys.

How do I bind a variable IN list?

A common question on the forums, and one that is frequently implemented wrong makes for an interesting discussion

If exists update else insert

A common pattern is to take take a set of values and update an existing record in the database if it exists or insert a new record if it does not. Simple, but often done wrong.