vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello What is correct syntax to do declare unique constraint on two fields in table (UDB 8.2, Win)? Statement: CREATE TABLE mytest( p1 INTEGER NOT NULL, p2 INTEGER NOT NULL, CONSTRAINT myunique CHECK(UNIQUE(p1,p2)) )@ give me an error: SQL0104N Unexpected element founded ")" after text "CHECK( unique(p1,p2)". Acceptable elements are: "<interval_qualifier> ". I know, I can declare unique index on this fields, but....how do this with UNIQUE? Thanks Yaro |
| |||
| Yaro wrote: > Hello > > What is correct syntax to do declare unique constraint on two fields in > table (UDB 8.2, Win)? CREATE TABLE mytest( p1 INTEGER NOT NULL, p2 INTEGER NOT NULL, CONSTRAINT myunique UNIQUE(p1,p2) )@ Art S. Kagel > Statement: > > CREATE TABLE mytest( > p1 INTEGER NOT NULL, > p2 INTEGER NOT NULL, > CONSTRAINT myunique CHECK(UNIQUE(p1,p2)) > )@ > > give me an error: > > SQL0104N Unexpected element founded ")" after text "CHECK( unique(p1,p2)". > Acceptable elements are: "<interval_qualifier> ". > > I know, I can declare unique index on this fields, but....how do this with > UNIQUE? > > Thanks > Yaro > > |