In Sybase you can leave out the "CONSTRAINT constraint_name" part of the 
statement. As far as uniqueness is concerned the following two statements 
work together:

        CREATE TABLE t1 (i INTEGER, CONSTRAINT c PRIMARY KEY (i))

        CREATE TABLE t2 (i INTEGER, CONSTRAINT c PRIMARY KEY (i))

Even the following two work together just fine:

        CREATE TABLE t1 (i INTEGER, CONSTRAINT c PRIMARY KEY (i))

        CREATE TABLE t2 (i1 INTEGER, i2 INTEGER,
                CONSTRAINT c PRIMARY KEY (i1),
                CONSTRAINT c FOREIGN KEY (i2) REFERENCES t1 (i))

So the constraint_name is basically just a comment in Sybase...

Peter


        

On Thursday 29 November 2001 23:49, Dain Sundstrom wrote:
> Does a table constraint name need to be universally unique, unique within
> the table, or not unique at all?
>
> By constraint name, I mean pkProduct and fkCategory in the SQL that follow:
>
> CREATE TABLE product
> (id  VARCHAR(40),
> name VARCHAR(100),
> category VARCHAR(40),
> ...
> CONSTRAINT pkProduct PRIMARY KEY (id),
> CONSTRAINT fkCategory FOREIGN KEY (category)
>       REFERENCES categroy(id))
>
> -dain
>
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to