Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 10 of 13 total |
X-Copying tbl files? |
Fri, May 29 2009 5:08 AM | Permanent Link |
"Hedley Muscroft" | Hi,
I have two identically structured databases and I simply want to copy the contents of a table from one database to the other database. With DBISAM I could simply copy over the .dat, .idx and .blb files, overwriting the destination ones - no problem. I understand that with EDB the actual table structures are now stored separately in a catalog file (EDBDatabase.EDBCat) and that the .edbtbl, ..edbidx and .edbblb files are merely "containers" for data. However, if the two databases are structurally completely identical, shouldn't I be able to copy over the "container" files without a problem? I have tried this, but it results in a 'metadata error' message. Is there any quick way around this which will allow me to xcopy .edbtbl, .edbidx and edbblb files? Many thanks! Hedley |
Fri, May 29 2009 6:15 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Hedley
Try copying the catalog file .EDBCfg as well. This is the file that contains the table definitions and it needs to be in sync with the tables for things to work. Roy Lambert |
Fri, May 29 2009 10:07 AM | Permanent Link |
Fernando Dias Team Elevate | Roy,
The file that contains the catalog is, by default, "EDBDatabase.EDBCat". ".EDBCfg" is the default extension of the configuration file. -- Fernando Dias [Team Elevate] |
Fri, May 29 2009 10:25 AM | Permanent Link |
Fernando Dias Team Elevate | Hedley,
You can't arbitrarily copy files between database directories except if you copy *all files*, i.e. all table files, index files, blob files and the catalog file. You can copy the contents of a single table to the same table in another identical database by doing a backup of the source database and restoring only the table you want into the destination database. -- Fernando Dias [Team Elevate] |
Fri, May 29 2009 10:29 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Fernando
You're dead right - I looked i the wrong directory - thanks for the correction. Hopefully I haven't confused Hedley to much. Roy Lambert |
Fri, May 29 2009 3:27 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Hedley,
As already noted, if you copy the .edbcat and all of the table files (basically everything in the database directory), then you should be fine. -- Tim Young Elevate Software www.elevatesoft.com |
Sat, May 30 2009 7:46 AM | Permanent Link |
"Hedley Muscroft" | Hi Tim et al,
> As already noted, if you copy the .edbcat and all of the table files > (basically everything in the database directory), then you should be fine. Perhaps I may not have explained this correctly in the original post? I *only* want to copy one table between databases. Both databases have identical structures. Specifically, I have a "Category" table which contains lists of Occupations, Marital Statuses, Patient Statuses etc. etc. This is a simple table with an ID and a VARCHAR value. Sometimes a customer will create a NEW database but want to copy over all the categories from another database. In DBISAM, I just copied the Category.dat, Category.idx and Category.blb files. If the database definition is IDENTICAL, shouldn't I just be able to copy over Category.EDBTbl, Category.EDBIdx and Category.EDBBlb? I have tried and I get a metadata error, which seems strange if both databases have the same structure. If the answer is simply that you can't xcopy individual table files over, then what would you suggest as the easiest way to achieve this? Many thanks! |
Sat, May 30 2009 1:45 PM | Permanent Link |
Uli Becker | Hedley.
> Perhaps I may not have explained this correctly in the original post? I > *only* want to copy one table between databases. Both databases have > identical structures. How about using a script like this: SCRIPT BEGIN use Database2; Execute Immediate 'Create Table TableToCopy as select * from Database1.OriginalTable with data'; END Uli |
Sun, May 31 2009 7:33 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Hedley
If the two catalog files are identical then you should (I have) indeed be able to just copy the data files over, but I doubt that they are. When you create a new database the tables will be version 1, if you make any alterations the version number will be different and its possibly this that prevents the simple copy operation. If the two databases exist simultaneously and can be accessed simultaneously a simple INSERT INTO ... SELECT FROM operation should (I think) work. If not Export & Import will probably be the easiest way. There have been posts about this before and Tim has been asked about a facility to bring tables and catalog into sync but I don't remember his reply. It might be "it'll be in 2.x" but I really can't recall. Roy Lambert [Team Elevate] |
Sun, May 31 2009 12:42 PM | Permanent Link |
Fernando Dias Team Elevate | Hedley Muscroft,
> Perhaps I may not have explained this correctly in the original post? I > *only* want to copy one table between databases. Both databases have > identical structures. You have explained correctly, and I already gave you the answer: BACKUP and then RESTORE only the table you want to copy. INSERT ... SELECT may also work, as already suggested by Roy, provided that there are no rows in the destination table that can collide with the inserted rows, unless you delete all row before the insert - but that can also be a problem if you have RI constraints defined. So, in conclusion, my opinion is that the best is to BACKUP and then RESTORE the table you want to copy. You must however be aware that RESTORE doesn't verify the existing referential integrity constraints, so if the destination database already contains data and you have RI constraints defined, you may end up with an inconsistent database state. -- Fernando Dias [Team Elevate] |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |