Just because you can do something, doesn’t necessarily mean that you should. Case in point, database object names. Yes, you can call a table in Oracle pretty much anything you want, including ‘TABLE.’ Using quotes allows you to do some pretty silly things like use reserved words, mixed case names, and worse.

On a call today someone mentioned that they found it odd that you could have a table and an index share a name. Yes, you CAN do that. But maybe you could try not to do that?. Just for readability sake, try a little harder maybe?

Here’s a fun one, a table called ‘INDEX.’ Which has a column named ‘INDEX.’ Which has an index called ‘INDEX.’ You laugh, but I have seen some crazy stuff out there. I shouldn’t have been surprised, but I was to find that SQL Developer fully handled this scenario. You see, even our testers have to spend precious time making sure that the stuff you CAN do but shouldn’t, actually works. I can only imagine what kind of fun the parser folks have with this kind of stuff.

Don’t try this at home, kids!

The Mythbusters would definitely not approve!

What weird stuff have you been asked to support?

Here’s another fun example from the field. A very large organization had decided to store the lookup values for every ID in every table they were referenced so as not to make it ‘hard’ for their support staff to join them with the appropriate parent tables. Imagine SCOTT.EMP with a ‘DeptName’ field that accompanied the ‘DEPTNO’ field. I think that’s what known as -1 Normal Form.

I’m sure you can top me. Let’s hear it!

Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

6 Comments

  1. Hi Jeff,

    oh yes, ACCESS->Oracle via ODBC, just say no! I think that document is still on the Toad files area. I’d forgotten about that one. shudder!

    Cheers,
    Norm.

  2. I once got this from a vendor:

    alter table x
    add constraint x_col_chk check (col in (‘Y’,’N’,NULL));

    The NULL bit renders the whole thing broken, and ANYTHING gets accepted as being valid.

    Gruesome details of why the above is a major fail at http://toadfororacle.com/thread.jspa?threadID=29681 start at the top and scroll down. (Stating the obvious again!)

    Cheers,
    Norm.

    • JeffS

      How many horror stories start or end with NULL? Has to be one of the least understood concepts in the relational database world.

      Thanks for sharing Norm, but this isn’t as bad as your ACCESS > Oracle Explain Plan you published a few years back!

Reply To Norm Cancel Reply