|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem with restoring
hi,
I have before insert triggers on some of my tables, which they generate new key ID for the table. The problem I am facing is that when I restore my data from a backed up file, I get new IDs for the tables. Is there any way to deactivate the triggers. I am using FB1.5, also I use TIBRestoreService for the restore. thanks |
|
#2
|
|||
|
|||
|
Still waiting for an answer, any help would be appreciated.
Nasben ![]() |
|
#3
|
|||
|
|||
|
Quote:
Can you explain what do you mean by "when I restore my data from a backed up file, I get new IDs for the tables"? Maybe you need to reset generator values (if I understand your question)? And YES, there IS a way to deactivate trigger. Use this syntax: ALTER TRIGGER TRIGGER_NAME_BI INACTIVE; For setting (manually) genarator value, try SET GENERATOR GEN_NAME TO SOME_VALUE; -- Best regards, Fikret Hasovic http://fikret.fbtalk.net FirebirdSQL Foundation member. - Join today at http://www.firebirdsql.org/ff/foundation JEDI VCS contributor http://jedivcs.sourceforge.net/ |
|
#4
|
||||
|
||||
|
There is no way that you can get new IDs while restoring if restored corectly !
Are you restoring and overwriting the initial database ? Try restoring to another location and see what happens ... |
|
#5
|
|||
|
|||
|
Quote:
I meant restoring the data which was backed up using the TIBBackupService component. It looks to me like when the TIBRestoreService doing the restore it's using INSERTS, which in my case making the on before insert trigger to be executed, therefore it's generating a new ID for the table. My before insert trigger looks like this: CREATE TRIGGER A_ADDRESS_BI0 FOR A_ADDRESS ACTIVE BEFORE INSERT POSITION 0 AS begin new.address_id = gen_id(ADDRESS_COUNT,1,1) end where ADDRESS_COUNT is a generator I hope this is clearer now. Thanks |
|
#6
|
|||
|
|||
|
Quote:
Yes i am overwriting an existing db, I shall try to restore to another location and see what will happen. Thanks |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Problem with restoring |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|