Subject Re: [firebird-support] Re: Differences when adding a Primary Key
Author Walter R. Ojeda Valiente
Hello Ricardo

Thank you for your answer, but that is not the problem.

Without using CONSTRAINT doesn't work and in such case the name is choosed by Firebird, not for me.

Greetings.

Walter.




On Fri, Aug 21, 2015 at 1:43 PM, Ricardo Uzcategui ricardouven@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
 

hi. Maybe you post an ilegal name or this name are not unique for entery database objects name's. every object in firebird database must be unique. no matters if the same name is used on diferent tables.

On Fri, Aug 21, 2015 at 12:24 PM, 'Walter R. Ojeda Valiente' sistemas2000profesional@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
 

Nobody knows?

Nobody has any idea?

Greetings.

Walter.


On Thu, Aug 20, 2015 at 10:45 AM, Walter R. Ojeda Valiente <sistemas2000profesional@...> wrote:
Hello everybody

For add a Primary Key to a table we can write:

ALTER TABLE MyTable ADD PRIMARY KEY (ID);

or we can write:

ALTER TABLE MyTable ADD CONSTRAINT MyPK PRIMARY KEY (ID);

In the first case, the Firebird puts the name of the Primary Key, in the second case we choose that name, but...

Why sometimes the first case fails and the second case always work?

Of course that the table has not a Primary Key yet and the ID column has not nulls neither duplicated values.

But (just sometimes) the first case fails.

Greetings.

Walter.





--
Ricardo...