Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread RESTORE table from 1 database into another ... what are the rules?
Sun, Dec 4 2011 6:22 AMPermanent Link

AdamBrett

Fullwell Mill

Avatar

I have a database with some 'system' tables which contain useful resources.

When I make a product for a new customer I need most of these resources, but the other tables in the application will differ.

I need a simple method for transferring data from 1 database to another.

Usually I use EDBManager, and drag and drop the table icon into a SQL script to create an "insert" statement ... this is very useful & works.

However, I would prefer to create a semi-permanent EDBBkp file with the required resources:

--On database 1
BACKUP DATABASE "OldCustomer" AS "SystemComponents" TO STORE "BackUp" TABLES "SysResources", "SysTypes", "SysSearches", SysStatus" [etc.]

Then I would like to be able call RESTORE on this back up file & restore these 2 tables to the new database.


--On database 2
RESTORE Database Test FROM "SystemComponents" IN STORE "BackUp"

However, when I do this it does nothing. I don't see any table objects appear in database 2.

If I add the "INCLUDE CATALOG" keywords at the end of each statement I get the data I need, but I also get empty table structures for ALL the tables in database 1, not just the few tables listed in the BACKUP statement.

Is there anyway around this?
Sun, Dec 4 2011 9:31 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


I don't think there's a way round it, but since John Hay demonstrated my lack of SQL expertise its only fair someone else can shoot me down here.

The problem is that ElevateDB is centred around a catalog whilst DBISAM was centred around the table files. Without the entry in the catalog ElevateDB doesn't even believe a table exists Smiley

I use export and import to move data from my live system to development for testing purposes but that doesn't create the tables merely populates them.

As things stand I think you'll need something to create the table and something to populate it, or combine the two in a script.

Roy Lambert [Team Elevate]
Sun, Dec 4 2011 1:00 PMPermanent Link

AdamBrett

Fullwell Mill

Avatar

Thanks Roy,

Though I have used it elsewhere, I hadn't thought to use EXPORT & IMPORT ... as I've really only used them in the past to do things like pass tables to Excel files or other external formats & vice-versa.

While this lacks the elegance of a single EDBBkp file containing a selection of tables, I only need 1 exported file per table ... which is pretty good.
Mon, Dec 5 2011 6:35 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< If I add the "INCLUDE CATALOG" keywords at the end of each statement I
get the data I need, but I also get empty table structures for ALL the
tables in database 1, not just the few tables listed in the BACKUP
statement. >>

If you want just certain table structures to be backed up, then there isn't
any way to do that in EDB.  In general, the TABLES clause only applies to
table data, not table structures/metadata.

--
Tim Young
Elevate Software
www.elevatesoft.com
Image