Posts Tagged ‘sql’

Check These SQL Beauties Out

Participation in the Obfuscated SQL Code Contest expired on April 1st. The SQL code that was submitted was not only obfuscated but also beautiful and artful.

When the contest started, I thought that we could just vote on the entries and select the most popular as the winner. But after seeing the entries, I believe that […]

Oracle SQL and PL/SQL Bad Practices Document

The document below contains patterns of bad SQL and PL/SQL code that Gojko Adzic has repeatedly found in various applications and databases. Some of the bad practices include:

Use of WHEN OTHERS in exception handling. Embedding complex SQL inside PL/SQL code. Poor PL/SQL error handling. Hardcoding the size of PL/SQL variables. Not using bind variables. Storing ROWIDs for later reference. Storing […]

Oracle Community Contest: Obfuscated SQL Code

Do you think there is a point in arranging an Obfuscated SQL Contest, modeled after the infamous Obfuscated C Contest? Chen Shapira asked. I replied: Great idea! So, welcome to the first ever Oracle Community contest.

To learn more, or to participate, proceed to this page on OracleCommunity.net.

Better SQL Formatter in Oracle SQL Developer, Finally a Reality

As mentioned on OracleCommunity.net, Oracle SQL Developer 1.5 Early Adopter 1 (EA1) is now available for download. As with any new release, there are new features and bug fixes. But, they are not yet detailed in the release notes.

However, I know that the one feature that I have been eagerly waiting for is finally here, […]

Most Developers are Young and Clueless About Databases and SQL

That’s what Stephane Faroult claims in the third part of his three part video series about SQL database performance best practices (shown below). Do you agree with him?

For sure, there exist young database developers whose level of expertise is still very shallow. But, isn’t that how we all started? As you grow older and learn […]

Beware of Comments in SQL

In SQL and PL/SQL there are two comment styles you can use, single-line and multi-line:

Multi-line comments begin with a slash and an asterisk (/*) and end with an asterisk and a slash (*/). the comment can span multiple lines. single-line comments begin with — (two hyphens) and end with a line break. The comment text cannot […]

The Smallest Database Management System Is Just 359 Kilobytes

As you may already know, Google recently released Google Gears, an open source browser extension that lets developers create web applications that can run offline using JavaScript APIs.

Google Gears provides three key features:

A local server, to cache and serve application resources (HTML, JavaScript, images, etc.) without needing to contact a server. […]

Give Me One Minute And I’ll Tell You If You Are Liberal Or Conservative

This Tuesday is election day in the United States. It’s a big day. Political enthusiasts from both the Republican and Democrat parties go to the polls and vote for their preferred candidates for member of Congress, state legislature and governor.

But, what does this have to do with databases. Well, it turns out that the SQL […]

Previously Undocumented LNNVL SQL Function Buggy

LNNVL is a SQL function that takes a condition as an argument. It returns TRUE if the condition is FALSE or NULL. It returns FALSE if the condition is TRUE. It is available but not documented in Oracle database versions prior to 10gR1.

In his comment to my previous post about this function, Laurent demonstrated how […]

Cool Undocumented SQL Function SYS_OP_MAP_NONNULL and Some Alternatives

In Oracle, NULL does not equal NULL:

EDDIE@XE> SELECT ‘hi there’ 2 FROM DUAL 3 WHERE NULL = NULL;

no rows selected

But sometimes, if not most of the times, you do want the condition NULL = NULL to return true. For example:

[…]