Wednesday 27 March 2013

Things I Hate #344

Just a quickie, but in the long, long list of things that really irritate me..

SQL Databases that insist on enclosing table/field names with other characters. Usually quotes or square brackets.

SQL is an amazing language. On the face of it, it's incredibly arcane, but it's surprisingly versatile and powerful. However, some implementations really keep it stuck in the 1970s.

I'm using Apache Derby for the first time, and considering it's a modern project, I'm surprised I have to use quotes around table and field names.

Is it really necessary to have to do this:

SELECT
 "project"."proj_name",
 "project"."proj_root"
FROM
 APP."project"
WHERE
 "proj_id" = 5

And let's not even get on to update queries, where you have to offensive things like this:

UPDATE
 APP."project"
SET
 "proj_name" = '',
 "proj_path" = ''
WHERE
 "proj_id" = 5

It's just ugly, and unnecessary when other engines manage to cope perfectly fine without it.  Even Microsoft's SQL Server can cope without those hideous square brackets everywhere that it used to insist upon.