Re: [firebird-support] Re: Differences when adding a Primary Key

2015-08-24 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
Hello Ann

Well, that was not the case, because without the word CONSTRAINT has failed
and with that word has worked fine and I was the only user of the database
at that moment.

But no problem, I know the solution: always use the word CONSTRAINT.

Greetings.

Walter.




On Sun, Aug 23, 2015 at 12:37 PM, liviusliv...@poczta.onet.pl
[firebird-support] firebird-support@yahoogroups.com wrote:



 Hi,

 have you sample database to reproduce this.
 How you test this difference? Have you some backup of database and restore
 it and then test this two options?

 regards,
 Karol Bieniaszewski


 *From:* mailto:firebird-support@yahoogroups.com
 firebird-support@yahoogroups.com
 *Sent:* Sunday, August 23, 2015 5:48 AM
 *To:* firebird-support@yahoogroups.com
 *Subject:* Re: [firebird-support] Re: Differences when adding a Primary
 Key



 Nobody knows the answer?

 Well, then I shall add this to the Firebird's mysteries.

 Greetings.

 Walter.


 On Fri, Aug 21, 2015 at 4:47 PM, Walter R. Ojeda Valiente 
 sistemas2000profesio...@gmail.com wrote:

 Hello Ann

 Well, the world has not falled out, nothing so dangerous, the error
 message is:

 Cannot commit transaction:
 The insert failed because a column definition includes validation 
 constraints.
 validation error for column ID, value *** null ***.

 The question is:

 Why without using CONSTRAINT appears that message but using CONSTRAINT
 all works fine?

 And there are not row/s with a NULL value in the column ID.

 At least, they are not showed with the following query:

 SELECT
*
 FROM
MyTable
 WHERE
ID IS NULL

 So, it seems very strange to me. The logic for me is: both works or both
 fails, but why one fails and the other works?

 Greetings.

 Walter.






 On Fri, Aug 21, 2015 at 2:43 PM, Ann Harrison aharri...@ibphoenix.com
 [firebird-support] firebird-support@yahoogroups.com wrote:




 On Aug 21, 2015, at 2:13 PM, 'Walter R. Ojeda Valiente'
 sistemas2000profesio...@gmail.com [firebird-support] 
 firebird-support@yahoogroups.com wrote:


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



 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?

 But (just sometimes) the first case fails.



 How does it fail?  What's the error message? Or does it kill the
 connection?  Crash the server?  Freeze the O/S?  Set the machine on fire?

 Cheers,

 Ann





 



Re: [firebird-support] Re: Differences when adding a Primary Key

2015-08-24 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
Hello Karol

No, I don't have a backup previous to add the Primary Key then I can use
for reproduce the problem.

Using ISQL, one time I try to add the Primary Key without using the word
CONSTRAINT, seconds later I try again but using the word CONSTRAINT. The
first time had failed, the second time worked fine.

I was curious ... why?

I think that a possibility is that the name INTEG_47 was previously used
but not eliminated of the metadata.

INTEG_47 was the name of the failed Primary Key, as ISQL shows me.

The table had not NULL neither duplicated values in the column ID.

Greetings.

Walter.



On Sun, Aug 23, 2015 at 12:37 PM, liviusliv...@poczta.onet.pl
[firebird-support] firebird-support@yahoogroups.com wrote:



 Hi,

 have you sample database to reproduce this.
 How you test this difference? Have you some backup of database and restore
 it and then test this two options?

 regards,
 Karol Bieniaszewski


 *From:* mailto:firebird-support@yahoogroups.com
 firebird-support@yahoogroups.com
 *Sent:* Sunday, August 23, 2015 5:48 AM
 *To:* firebird-support@yahoogroups.com
 *Subject:* Re: [firebird-support] Re: Differences when adding a Primary
 Key



 Nobody knows the answer?

 Well, then I shall add this to the Firebird's mysteries.

 Greetings.

 Walter.


 On Fri, Aug 21, 2015 at 4:47 PM, Walter R. Ojeda Valiente 
 sistemas2000profesio...@gmail.com wrote:

 Hello Ann

 Well, the world has not falled out, nothing so dangerous, the error
 message is:

 Cannot commit transaction:
 The insert failed because a column definition includes validation 
 constraints.
 validation error for column ID, value *** null ***.

 The question is:

 Why without using CONSTRAINT appears that message but using CONSTRAINT
 all works fine?

 And there are not row/s with a NULL value in the column ID.

 At least, they are not showed with the following query:

 SELECT
*
 FROM
MyTable
 WHERE
ID IS NULL

 So, it seems very strange to me. The logic for me is: both works or both
 fails, but why one fails and the other works?

 Greetings.

 Walter.






 On Fri, Aug 21, 2015 at 2:43 PM, Ann Harrison aharri...@ibphoenix.com
 [firebird-support] firebird-support@yahoogroups.com wrote:




 On Aug 21, 2015, at 2:13 PM, 'Walter R. Ojeda Valiente'
 sistemas2000profesio...@gmail.com [firebird-support] 
 firebird-support@yahoogroups.com wrote:


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



 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?

 But (just sometimes) the first case fails.



 How does it fail?  What's the error message? Or does it kill the
 connection?  Crash the server?  Freeze the O/S?  Set the machine on fire?

 Cheers,

 Ann





 



Re: [firebird-support] Re: Differences when adding a Primary Key

2015-08-24 Thread liviusliv...@poczta.onet.pl [firebird-support]
Hi,

what about drop this PK
do backup restore and try again?

P.S.
If you previously name some constraint as INTEG... then conflict with name can 
appear 

regards,
Karol Bieniaszewski

From: mailto:firebird-support@yahoogroups.com 
Sent: Monday, August 24, 2015 5:00 PM
To: firebird-support@yahoogroups.com 
Subject: Re: [firebird-support] Re: Differences when adding a Primary Key

  

Hello Karol 

No, I don't have a backup previous to add the Primary Key then I can use for 
reproduce the problem.

Using ISQL, one time I try to add the Primary Key without using the word 
CONSTRAINT, seconds later I try again but using the word CONSTRAINT. The first 
time had failed, the second time worked fine.

I was curious ... why?

I think that a possibility is that the name INTEG_47 was previously used but 
not eliminated of the metadata.

INTEG_47 was the name of the failed Primary Key, as ISQL shows me.

The table had not NULL neither duplicated values in the column ID.

Greetings.

Walter.



On Sun, Aug 23, 2015 at 12:37 PM, liviusliv...@poczta.onet.pl 
[firebird-support] firebird-support@yahoogroups.com wrote:


  Hi,

  have you sample database to reproduce this.
  How you test this difference? Have you some backup of database and restore it 
and then test this two options?

  regards,
  Karol Bieniaszewski


  From: mailto:firebird-support@yahoogroups.com 
  Sent: Sunday, August 23, 2015 5:48 AM
  To: firebird-support@yahoogroups.com 
  Subject: Re: [firebird-support] Re: Differences when adding a Primary Key


  Nobody knows the answer? 

  Well, then I shall add this to the Firebird's mysteries.

  Greetings.

  Walter.


  On Fri, Aug 21, 2015 at 4:47 PM, Walter R. Ojeda Valiente 
sistemas2000profesio...@gmail.com wrote:

Hello Ann 

Well, the world has not falled out, nothing so dangerous, the error message 
is:

Cannot commit transaction:
The insert failed because a column definition includes validation 
constraints. validation error for column ID, value *** null ***.



The question is:


Why without using CONSTRAINT appears that message but using CONSTRAINT all 
works fine?


And there are not row/s with a NULL value in the column ID.


At least, they are not showed with the following query:


SELECT
   *
FROM
   MyTable
WHERE
   ID IS NULL


So, it seems very strange to me. The logic for me is: both works or both 
fails, but why one fails and the other works?


Greetings.


Walter.











On Fri, Aug 21, 2015 at 2:43 PM, Ann Harrison aharri...@ibphoenix.com 
[firebird-support] firebird-support@yahoogroups.com wrote:




  On Aug 21, 2015, at 2:13 PM, 'Walter R. Ojeda Valiente' 
sistemas2000profesio...@gmail.com [firebird-support] 
firebird-support@yahoogroups.com wrote:


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



  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?

  But (just sometimes) the first case fails.



  How does it fail?  What's the error message? Or does it kill the 
connection?  Crash the server?  Freeze the O/S?  Set the machine on fire?

  Cheers,

  Ann





Re: [firebird-support] Re: Differences when adding a Primary Key

2015-08-24 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
Hello Karol

As I had said before, it is a mystery for me. The Primary Keys created by
me always begin with the PK_ characters, if they begin with INTEG_ is
because were created by ISQL.

But not problem at all, using CONSTRAINT it is solved.

Greetings.

Walter.


On Mon, Aug 24, 2015 at 12:51 PM, liviusliv...@poczta.onet.pl
[firebird-support] firebird-support@yahoogroups.com wrote:



 Hi,

 what about drop this PK
 do backup restore and try again?

 P.S.
 If you previously name some constraint as INTEG... then conflict with name
 can appear

 regards,
 Karol Bieniaszewski

 *From:* mailto:firebird-support@yahoogroups.com
 firebird-support@yahoogroups.com
 *Sent:* Monday, August 24, 2015 5:00 PM
 *To:* firebird-support@yahoogroups.com
 *Subject:* Re: [firebird-support] Re: Differences when adding a Primary
 Key



 Hello Karol

 No, I don't have a backup previous to add the Primary Key then I can use
 for reproduce the problem.

 Using ISQL, one time I try to add the Primary Key without using the word
 CONSTRAINT, seconds later I try again but using the word CONSTRAINT. The
 first time had failed, the second time worked fine.

 I was curious ... why?

 I think that a possibility is that the name INTEG_47 was previously used
 but not eliminated of the metadata.

 INTEG_47 was the name of the failed Primary Key, as ISQL shows me.

 The table had not NULL neither duplicated values in the column ID.

 Greetings.

 Walter.



 On Sun, Aug 23, 2015 at 12:37 PM, liviusliv...@poczta.onet.pl
 [firebird-support] firebird-support@yahoogroups.com wrote:


 Hi,

 have you sample database to reproduce this.
 How you test this difference? Have you some backup of database and
 restore it and then test this two options?

 regards,
 Karol Bieniaszewski


 *From:* mailto:firebird-support@yahoogroups.com
 firebird-support@yahoogroups.com
 *Sent:* Sunday, August 23, 2015 5:48 AM
 *To:* firebird-support@yahoogroups.com
 *Subject:* Re: [firebird-support] Re: Differences when adding a Primary
 Key


 Nobody knows the answer?

 Well, then I shall add this to the Firebird's mysteries.

 Greetings.

 Walter.


 On Fri, Aug 21, 2015 at 4:47 PM, Walter R. Ojeda Valiente 
 sistemas2000profesio...@gmail.com wrote:

 Hello Ann

 Well, the world has not falled out, nothing so dangerous, the error
 message is:

 Cannot commit transaction:
 The insert failed because a column definition includes validation 
 constraints.
 validation error for column ID, value *** null ***.

 The question is:

 Why without using CONSTRAINT appears that message but using CONSTRAINT
 all works fine?

 And there are not row/s with a NULL value in the column ID.

 At least, they are not showed with the following query:

 SELECT
*
 FROM
MyTable
 WHERE
ID IS NULL

 So, it seems very strange to me. The logic for me is: both works or both
 fails, but why one fails and the other works?

 Greetings.

 Walter.






 On Fri, Aug 21, 2015 at 2:43 PM, Ann Harrison aharri...@ibphoenix.com
 [firebird-support] firebird-support@yahoogroups.com wrote:




 On Aug 21, 2015, at 2:13 PM, 'Walter R. Ojeda Valiente'
 sistemas2000profesio...@gmail.com [firebird-support] 
 firebird-support@yahoogroups.com wrote:


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



 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?

 But (just sometimes) the first case fails.



 How does it fail?  What's the error message? Or does it kill the
 connection?  Crash the server?  Freeze the O/S?  Set the machine on fire?

 Cheers,

 Ann







 



Re: [firebird-support] Re: Differences when adding a Primary Key

2015-08-23 Thread liviusliv...@poczta.onet.pl [firebird-support]
Hi,

have you sample database to reproduce this.
How you test this difference? Have you some backup of database and restore it 
and then test this two options?

regards,
Karol Bieniaszewski


From: mailto:firebird-support@yahoogroups.com 
Sent: Sunday, August 23, 2015 5:48 AM
To: firebird-support@yahoogroups.com 
Subject: Re: [firebird-support] Re: Differences when adding a Primary Key

  

Nobody knows the answer? 

Well, then I shall add this to the Firebird's mysteries.

Greetings.

Walter.


On Fri, Aug 21, 2015 at 4:47 PM, Walter R. Ojeda Valiente 
sistemas2000profesio...@gmail.com wrote:

  Hello Ann 

  Well, the world has not falled out, nothing so dangerous, the error message 
is:

  Cannot commit transaction:
  The insert failed because a column definition includes validation 
constraints. validation error for column ID, value *** null ***.



  The question is:


  Why without using CONSTRAINT appears that message but using CONSTRAINT all 
works fine?


  And there are not row/s with a NULL value in the column ID.


  At least, they are not showed with the following query:


  SELECT
 *
  FROM
 MyTable
  WHERE
 ID IS NULL


  So, it seems very strange to me. The logic for me is: both works or both 
fails, but why one fails and the other works?


  Greetings.


  Walter.











  On Fri, Aug 21, 2015 at 2:43 PM, Ann Harrison aharri...@ibphoenix.com 
[firebird-support] firebird-support@yahoogroups.com wrote:

  


On Aug 21, 2015, at 2:13 PM, 'Walter R. Ojeda Valiente' 
sistemas2000profesio...@gmail.com [firebird-support] 
firebird-support@yahoogroups.com wrote:


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



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?

But (just sometimes) the first case fails.



How does it fail?  What's the error message? Or does it kill the 
connection?  Crash the server?  Freeze the O/S?  Set the machine on fire?

Cheers,

Ann




Re: [firebird-support] Re: Differences when adding a Primary Key

2015-08-22 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
Nobody knows the answer?

Well, then I shall add this to the Firebird's mysteries.

Greetings.

Walter.


On Fri, Aug 21, 2015 at 4:47 PM, Walter R. Ojeda Valiente 
sistemas2000profesio...@gmail.com wrote:

 Hello Ann

 Well, the world has not falled out, nothing so dangerous, the error
 message is:

 Cannot commit transaction:
 The insert failed because a column definition includes validation
 constraints. validation error for column ID, value *** null ***.

 The question is:

 Why without using CONSTRAINT appears that message but using CONSTRAINT all
 works fine?

 And there are not row/s with a NULL value in the column ID.

 At least, they are not showed with the following query:

 SELECT
*
 FROM
MyTable
 WHERE
ID IS NULL

 So, it seems very strange to me. The logic for me is: both works or both
 fails, but why one fails and the other works?

 Greetings.

 Walter.






 On Fri, Aug 21, 2015 at 2:43 PM, Ann Harrison aharri...@ibphoenix.com
 [firebird-support] firebird-support@yahoogroups.com wrote:




 On Aug 21, 2015, at 2:13 PM, 'Walter R. Ojeda Valiente'
 sistemas2000profesio...@gmail.com [firebird-support] 
 firebird-support@yahoogroups.com wrote:


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



 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?

 But (just sometimes) the first case fails.


 How does it fail?  What's the error message? Or does it kill the
 connection?  Crash the server?  Freeze the O/S?  Set the machine on fire?

 Cheers,

 Ann

 





[firebird-support] Re: Differences when adding a Primary Key

2015-08-21 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
Nobody knows?

Nobody has any idea?

Greetings.

Walter.


On Thu, Aug 20, 2015 at 10:45 AM, Walter R. Ojeda Valiente 
sistemas2000profesio...@gmail.com 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.




Re: [firebird-support] Re: Differences when adding a Primary Key

2015-08-21 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
Hello Ann

Well, the world has not falled out, nothing so dangerous, the error message
is:

Cannot commit transaction:
The insert failed because a column definition includes validation
constraints. validation error for column ID, value *** null ***.

The question is:

Why without using CONSTRAINT appears that message but using CONSTRAINT all
works fine?

And there are not row/s with a NULL value in the column ID.

At least, they are not showed with the following query:

SELECT
   *
FROM
   MyTable
WHERE
   ID IS NULL

So, it seems very strange to me. The logic for me is: both works or both
fails, but why one fails and the other works?

Greetings.

Walter.






On Fri, Aug 21, 2015 at 2:43 PM, Ann Harrison aharri...@ibphoenix.com
[firebird-support] firebird-support@yahoogroups.com wrote:




 On Aug 21, 2015, at 2:13 PM, 'Walter R. Ojeda Valiente'
 sistemas2000profesio...@gmail.com [firebird-support] 
 firebird-support@yahoogroups.com wrote:


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



 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?

 But (just sometimes) the first case fails.


 How does it fail?  What's the error message? Or does it kill the
 connection?  Crash the server?  Freeze the O/S?  Set the machine on fire?

 Cheers,

 Ann

 



Re: [firebird-support] Re: Differences when adding a Primary Key

2015-08-21 Thread Ricardo Uzcategui ricardou...@cantv.net [firebird-support]
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'
sistemas2000profesio...@gmail.com [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 
 sistemas2000profesio...@gmail.com 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...


Re: [firebird-support] Re: Differences when adding a Primary Key

2015-08-21 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
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 ricardou...@cantv.net
[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'
 sistemas2000profesio...@gmail.com [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 
 sistemas2000profesio...@gmail.com 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...

 



Re: [firebird-support] Re: Differences when adding a Primary Key

2015-08-21 Thread Ann Harrison aharri...@ibphoenix.com [firebird-support]

 On Aug 21, 2015, at 2:13 PM, 'Walter R. Ojeda Valiente' 
 sistemas2000profesio...@gmail.com [firebird-support] 
 firebird-support@yahoogroups.com wrote:
 
 Without using CONSTRAINT doesn't work and in such case the name is choosed by 
 Firebird, not for me.
 
 
 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?
 
 But (just sometimes) the first case fails.
 

How does it fail?  What's the error message? Or does it kill the connection?  
Crash the server?  Freeze the O/S?  Set the machine on fire?

Cheers,

Ann