Why I love working on AskTom

Posted by

Today a question came in, and Swapnasis provided a nice simple test case, which makes my job so much easier.  Here’s a snippet from it


SQL> create table TTT(
  2    testid integer not null,
  3    value integer not null,
  4    time timestamp not null,
  5    unique(testid, time)
  6  );

Table created.

See line 5 ?

I’ve been working with Oracle for (well…I’d rather not say Smile) but lets just says “a number of years” dating back to version 6 of the database.  But in all of that time, I never knew that you could just write “unique”.  I have always done “constraint MY_CONSTRAINT unique (col1, col2)”.

Its probably also the reason I dont mind doing a few AskTom’s like today, ie, on a Saturday morning over breakfast coffee. Its free education Smile

#neverstoplearning

2 comments

  1. That’s what happens if you don’t read the manuals (and migrate from another platform) – you discover things that aren’t in the manuals without realising that they aren’t in the manuals. (It works back to at least 8i – once you’ve changed the timestamp type.)

  2. It also remains consistent if you get the metadata back (I just tried in 10.2.0.4 dbconsole, create ddl).

    But of course, having system-named check and unique constraints isn’t really the bee’s knees, eh?

Got some thoughts? Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.