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
) 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 ![]()
#neverstoplearning




Leave a Reply