Re: [firebird-support] Error creating Foreign key

2018-06-13 Thread Mourad Hedfi mou...@bilog.fr [firebird-support]
For example, I've 5 FK on this table and only the first was created and the
others, as shown, are in error :

ALTER TABLE  TABLE FINSMR_INDIC_SMR_ATR ADD CONSTRAINT
FK2_FINSMR_INDIC_SMR_ATR FOREIGN KEY (FINSMR_SP_CODE_FK_PK) REFERENCES
SP_SPECIALITE (SP_CODE_SQ_PK) ON DELETE CASCADE - This operation is not
defined for system tables.

ALTER TABLE FINSMR_INDIC_SMR_ATR ADD CONSTRAINT FK3_FINSMR_INDIC_SMR_ATR
FOREIGN KEY (FINSMR_ATR_CODE_FK_PK) REFERENCES
ATR_AVISCOMMISSIONTRANSPARENCE (ATR_CODE_SQ_PK) ON DELETE CASCADE - This
operation is not defined for system tables.

ALTER TABLE FINSMR_INDIC_SMR_ATR ADD CONSTRAINT FK4_FINSMR_INDIC_SMR_ATR
FOREIGN KEY (FINSMR_SP_CODE_FK_PK,FINSMR_ATR_CODE_FK_PK) REFERENCES
SPATR_SPEC_AVISTRANSPARENCE (SPATR_SP_CODE_FK_PK,SPATR_ATR_CODE_FK_PK) -
This operation is not defined for system tables

ALTER TABLE FINSMR_INDIC_SMR_ATR ADD CONSTRAINT FK5_FINSMR_INDIC_SMR_ATR
FOREIGN KEY (FINSMR_FIN_CODE_FK_PK, FINSMR_SP_CODE_FK_PK) REFERENCES
FINSP_INDSPE (FINSP_FIN_CODE_FK_PK,FINSP_SP_CODE_FK_PK) - This operation is
not defined for system tables.

I'm connected with sysdba user and I can create those FK with Flamerobin.

Bien cordialement.

*Mourad **Hedfi*
Directeur de projets
Tél. : 01 83 62 36 85

2018-06-13 8:32 GMT+01:00 Svein Erling Tysvær setys...@gmail.com
[firebird-support] :

>
>
> What are the names of the foreign keys? Just in case Firebird thinks two
> foreign keys are identical, e.g. the naming of both foreign keys have the
> same first 27 letters and only differ later (don't know if the limit is 27,
> I think it was 27 or 28 for tables earlier, have no clue about FKs). Are
> you allowed to create the foreign key if you use a completely different
> name for it?
>
> And what is the exact definition of the primary, foreign and unique keys
> for the tables in question?
>
> Set
>
> 2018-06-12 10:59 GMT+02:00 Mourad Hedfi mou...@bilog.fr
> [firebird-support] :
>
>>
>>
>> Hello All,
>>
>> I return to you after many tests and finally I've found that when I've
>> two or more successive FK to create, only the first is created and I've the
>> error "Object in use" for the others.
>>
>> I've tried :
>> 1. Add a commit command after every FK create command
>> 2. Disconnect  after every FK create command
>>
>> ==> always the same error.
>>
>> Doe's anyone have an idea to fix this problem ?
>>
>> Bien cordialement.
>>
>> *Mourad **Hedfi*
>> Directeur de projets
>> Tél. : 01 83 62 36 85
>>
>> 2018-05-31 9:22 GMT+01:00 Mourad Hedfi :
>>
>>> Hello,
>>>
>>> Thanks for your reply.
>>>
>>> 1. Why do you remove all FK?
>>> --> Data update covers all data's tables. I must remove all FK to be
>>> able to insert, delete records.
>>>
>>>
>>> 2. Why do you still use such old Firebird version?
>>> --> You are wright. It's a big client database and I mist have it's
>>> agreement to use a recent version.
>>>
>>>
>>> Many things was fixed since FB1.5 and i suppose that only real fix to
>>> your problem is using recent FB.
>>>
>>> You can try disconnect after every FK.
>>>
>>> --> I'll try this and tell you if it resolve the problem. Note that on
>>> 477 deleted FK, 326 are created.
>>>
>>>
>>> You can also try do select count(*) from updated tables but you say that
>>> you do backup and restore...
>>>
>>>
>>>
>>> Bien cordialement.
>>>
>>> *Mourad **Hedfi*
>>> Directeur de projets
>>> Tél. : 01 83 62 36 85
>>>
>>> 2018-05-31 8:42 GMT+01:00 liviuslivius liviusliv...@poczta.onet.pl
>>> [firebird-support] :
>>>


 Hi,

 Two questions
 1. Why do you remove all FK?
 2. Why do you still use such old Firebird version?

 Many things was fixed since FB1.5 and i suppose that only real fix to
 your problem is using recent FB.

 You can try disconnect after every FK.
 You can also try do select count(*) from updated tables but you say
 that you do backup and restore...



 Regards,
 Karol Bieniaszewski


>>>
>>
>>
>>
> 
>


Re: [firebird-support] Error creating Foreign key

2018-06-13 Thread Svein Erling Tysvær setys...@gmail.com [firebird-support]
What are the names of the foreign keys? Just in case Firebird thinks two
foreign keys are identical, e.g. the naming of both foreign keys have the
same first 27 letters and only differ later (don't know if the limit is 27,
I think it was 27 or 28 for tables earlier, have no clue about FKs). Are
you allowed to create the foreign key if you use a completely different
name for it?

And what is the exact definition of the primary, foreign and unique keys
for the tables in question?

Set

2018-06-12 10:59 GMT+02:00 Mourad Hedfi mou...@bilog.fr [firebird-support] <
firebird-support@yahoogroups.com>:

>
>
> Hello All,
>
> I return to you after many tests and finally I've found that when I've two
> or more successive FK to create, only the first is created and I've the
> error "Object in use" for the others.
>
> I've tried :
> 1. Add a commit command after every FK create command
> 2. Disconnect  after every FK create command
>
> ==> always the same error.
>
> Doe's anyone have an idea to fix this problem ?
>
> Bien cordialement.
>
> *Mourad **Hedfi*
> Directeur de projets
> Tél. : 01 83 62 36 85
>
> 2018-05-31 9:22 GMT+01:00 Mourad Hedfi :
>
>> Hello,
>>
>> Thanks for your reply.
>>
>> 1. Why do you remove all FK?
>> --> Data update covers all data's tables. I must remove all FK to be able
>> to insert, delete records.
>>
>>
>> 2. Why do you still use such old Firebird version?
>> --> You are wright. It's a big client database and I mist have it's
>> agreement to use a recent version.
>>
>>
>> Many things was fixed since FB1.5 and i suppose that only real fix to
>> your problem is using recent FB.
>>
>> You can try disconnect after every FK.
>>
>> --> I'll try this and tell you if it resolve the problem. Note that on
>> 477 deleted FK, 326 are created.
>>
>>
>> You can also try do select count(*) from updated tables but you say that
>> you do backup and restore...
>>
>>
>>
>> Bien cordialement.
>>
>> *Mourad **Hedfi*
>> Directeur de projets
>> Tél. : 01 83 62 36 85
>>
>> 2018-05-31 8:42 GMT+01:00 liviuslivius liviusliv...@poczta.onet.pl
>> [firebird-support] :
>>
>>>
>>>
>>> Hi,
>>>
>>> Two questions
>>> 1. Why do you remove all FK?
>>> 2. Why do you still use such old Firebird version?
>>>
>>> Many things was fixed since FB1.5 and i suppose that only real fix to
>>> your problem is using recent FB.
>>>
>>> You can try disconnect after every FK.
>>> You can also try do select count(*) from updated tables but you say that
>>> you do backup and restore...
>>>
>>>
>>>
>>> Regards,
>>> Karol Bieniaszewski
>>>
>>>
>>
>
>
> 
>


Re: [firebird-support] Error creating Foreign key

2018-06-12 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
12.06.2018 16:38, Mourad Hedfi mou...@bilog.fr [firebird-support] wrote:
> Yes, the problem is reproduced on EMS but not with Flamerobin.

   The difference between them is in transaction parameters. Transaction with 
"nowait" 
flag can get "object in use" error even of the object is not really in use 
because of lazy 
lock release.
   You must use "wait" transaction for metadata changes.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] Error creating Foreign key

2018-06-12 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi,
are you sure that you are the only one attachment to the database?Check this by 
mon$attachments if present in Fb1.5...You can try to change database file name 
if it is changed succesfully then you are the only one.
Try to add some delay after disconnect.
But your real cure is Firebird3.
Regards,Karol Bieniaszewski
null

Re: [firebird-support] Error creating Foreign key

2018-06-12 Thread Mourad Hedfi mou...@bilog.fr [firebird-support]
Thanks for your reply.

Yes, the problem is reproduced on EMS but not with Flamerobin.

I'm not in the same with you. I've not recompiled a stored procedured. I
can't determine exactly the problem origin.

I've backuped and restored the database but this's did'nt resolve the
problem.

I gues that the problem is releated to Firebird version. I'm trying to port
the database to Firebird 2.5.8 because the problem is'nt reproduced with
this version on Mac OS.

Bien cordialement.

*Mourad **Hedfi*
Directeur de projets
Tél. : 01 83 62 36 85

2018-06-12 15:24 GMT+01:00 blackfalconsoftw...@outlook.com
[firebird-support] :

>
>
> I am assuming that you are getting such an error with the db-manager you
> are using.
>
> I have seen a similar issue when using my EMS Firebird Database Manager.
>
> This often happens after I have recompiled a clean stored procedure
> several times with new modifications.
>
> I wonder if these issues are related.
>
> EMS Technical Support has responded that they hope to have such issues
> corrected by the next upgrade release.  From their point of view it is a
> db-manager issue.
>
> Steve Naidamast
> http://www.blackfalconsoftware.com
>
>
> 
>


Re: [firebird-support] Error creating Foreign key

2018-06-12 Thread Mourad Hedfi mou...@bilog.fr [firebird-support]
Hello All,

I return to you after many tests and finally I've found that when I've two
or more successive FK to create, only the first is created and I've the
error "Object in use" for the others.

I've tried :
1. Add a commit command after every FK create command
2. Disconnect  after every FK create command

==> always the same error.

Doe's anyone have an idea to fix this problem ?

Bien cordialement.

*Mourad **Hedfi*
Directeur de projets
Tél. : 01 83 62 36 85

2018-05-31 9:22 GMT+01:00 Mourad Hedfi :

> Hello,
>
> Thanks for your reply.
>
> 1. Why do you remove all FK?
> --> Data update covers all data's tables. I must remove all FK to be able
> to insert, delete records.
>
>
> 2. Why do you still use such old Firebird version?
> --> You are wright. It's a big client database and I mist have it's
> agreement to use a recent version.
>
>
> Many things was fixed since FB1.5 and i suppose that only real fix to your
> problem is using recent FB.
>
> You can try disconnect after every FK.
>
> --> I'll try this and tell you if it resolve the problem. Note that on 477
> deleted FK, 326 are created.
>
>
> You can also try do select count(*) from updated tables but you say that
> you do backup and restore...
>
>
>
> Bien cordialement.
>
> *Mourad **Hedfi*
> Directeur de projets
> Tél. : 01 83 62 36 85
>
> 2018-05-31 8:42 GMT+01:00 liviuslivius liviusliv...@poczta.onet.pl
> [firebird-support] :
>
>>
>>
>> Hi,
>>
>> Two questions
>> 1. Why do you remove all FK?
>> 2. Why do you still use such old Firebird version?
>>
>> Many things was fixed since FB1.5 and i suppose that only real fix to
>> your problem is using recent FB.
>>
>> You can try disconnect after every FK.
>> You can also try do select count(*) from updated tables but you say that
>> you do backup and restore...
>>
>>
>>
>> Regards,
>> Karol Bieniaszewski
>>
>> 
>>
>
>


Re: [firebird-support] Error creating Foreign key

2018-05-31 Thread Mourad Hedfi mou...@bilog.fr [firebird-support]
Hello,

Thanks for your reply.

1. Why do you remove all FK?
--> Data update covers all data's tables. I must remove all FK to be able
to insert, delete records.


2. Why do you still use such old Firebird version?
--> You are wright. It's a big client database and I mist have it's
agreement to use a recent version.


Many things was fixed since FB1.5 and i suppose that only real fix to your
problem is using recent FB.

You can try disconnect after every FK.

--> I'll try this and tell you if it resolve the problem. Note that on 477
deleted FK, 326 are created.


You can also try do select count(*) from updated tables but you say that
you do backup and restore...



Bien cordialement.

*Mourad **Hedfi*
Directeur de projets
Tél. : 01 83 62 36 85

2018-05-31 8:42 GMT+01:00 liviuslivius liviusliv...@poczta.onet.pl
[firebird-support] :

>
>
> Hi,
>
> Two questions
> 1. Why do you remove all FK?
> 2. Why do you still use such old Firebird version?
>
> Many things was fixed since FB1.5 and i suppose that only real fix to your
> problem is using recent FB.
>
> You can try disconnect after every FK.
> You can also try do select count(*) from updated tables but you say that
> you do backup and restore...
>
>
>
> Regards,
> Karol Bieniaszewski
>
> 
>


Re: [firebird-support] Error creating Foreign key

2018-05-31 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi,
Two questions 1. Why do you remove all FK?2. Why do you still use such old 
Firebird version?
Many things was fixed since FB1.5 and i suppose that only real fix to your 
problem is using recent FB.
You can try disconnect after every FK.You can also try do select count(*) from 
updated tables but you say that you do backup and restore...


Regards,Karol Bieniaszewski
null

[firebird-support] Error creating Foreign key

2018-05-30 Thread Mourad Hedfi mou...@bilog.fr [firebird-support]
Hello everybody,

I've an application witch update a database data.

The process to update data is :

   1. Delete all foreign keys
   2. Execute all update commands (insert, update, delete)
   3. Create  foreign keys

The problem is that foreign key creation return an error for some FK (50
from 477).

"-607-This operation is not defined for system tables."
"Table is in use."

It's a strange error because I've only one connection to the database in
the application and database is not opened in any other editor.

I've tried the following solutions :

   - In the application, before creating FK, I close the database connecion
   and I reopen it
   - I've backuped and restored the database

but always the same error.

I'm on Firebird 1.5 on Windows.

Can anyone tell me what's wrong and how to fix this problem


​Best regards.