Board index » delphi » Creating Primary Key on existing Interbase table

Creating Primary Key on existing Interbase table

Is there a way to create a Primary Key on an existing interbase table?
 

Re:Creating Primary Key on existing Interbase table


Quote
On Tue, 13 Apr 1999 14:48:23 -0500, "Mark G" <Mark...@aol.com> wrote:
>Is there a way to create a Primary Key on an existing interbase table?

Take a look at the ALTER TABLE statement. The Language Reference
manual for this statement lists constraints as a type of metadata
object that can be added using ALTER TABLE. PRIMARY KEY is a type of
constraint and is listed there.

//////////////////////////////////////////////////////////////////////////
Steve Koterski                  "The income tax has made liars out of more
Technical Publications          Americans than golf."
Borland                                         -- Will Rogers (1879-1964)
http://www.borland.com/delphi

Re:Creating Primary Key on existing Interbase table


Try:

    Alter Table TABLE_NAME Add Constraint CONSTRAINT_NAME Primary Key
(FIELD_NAME)

Regards,

Dan Palley
TRAMS, Inc.

Quote
Mark G <Mark...@aol.com> wrote in message

news:7f06gr$ejl2@forums.borland.com...
Quote
> Is there a way to create a Primary Key on an existing interbase table?

Re:Creating Primary Key on existing Interbase table


Hi,

Just wanted to add this. If the field is not null, then there is no way
other than to create another non-null field before adding the primary key.

(OR DO WE?)

Salim

Quote
Steve Koterski wrote in message <3713c91a.21037...@forums.inprise.com>...
>On Tue, 13 Apr 1999 14:48:23 -0500, "Mark G" <Mark...@aol.com> wrote:

>>Is there a way to create a Primary Key on an existing interbase table?

>Take a look at the ALTER TABLE statement. The Language Reference
>manual for this statement lists constraints as a type of metadata
>object that can be added using ALTER TABLE. PRIMARY KEY is a type of
>constraint and is listed there.

>//////////////////////////////////////////////////////////////////////////
>Steve Koterski                  "The income tax has made liars out of more
>Technical Publications          Americans than golf."
>Borland                                         -- Will Rogers (1879-1964)
>http://www.borland.com/delphi

Other Threads