Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread How moving data from one db to another?
Thu, Jan 21 2010 6:37 AMPermanent Link

Michael Reisch
I have to archive parts of my data e.g. Project No. 123 is finished, so I want to archive
that data.

My idea was to create a archive db and do the following:

create table "DBArchive"."Project" ( like "DBMain"."Project" )

insert into "DBArchive"."Project" select * from "DBMain"."Project" where Project_GUID =
'{123}'

delete "DBMain"."Project" where Project_GUID = '{123...}'

But it is not allowed to use Database qualifiers here.

Has somebody a idea how can I easy save particular data out of EDB to archive it. I need
also a way to save such an archived data back to main database.

regards
Michael
Thu, Jan 21 2010 5:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< But it is not allowed to use Database qualifiers here. >>

You should be able to use database qualifiers for the INSERT/DELETE, but not
the CREATE TABLE.  To execute the CREATE TABLE against the correct database,
just make sure that the TEDBQuery's DatabaseName property is set properly
before executing the SQL.

If you're using a script, then just do this:

BEGIN

USE DBArchive;

EXECUTE IMMEDIATE 'CREATE TABLE....

USE DBMain

EXECUTE IMMEDIATE 'INSERT INTO...
EXECUTE IMMEDIATE 'DELETE FROM...

END

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Jan 22 2010 3:24 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


Did you miss the point that he wants to use LIKE across databases which 2.03b7 doesn't like. So me trying to create a new table in my memory database using a table in nlh eg


create table junk (like "nlh".companies)

gives

ElevateDB Error #700 An error was found in the statement at line 1 and column 30 (Invalid expression . found, schema qualifier not allowed)

even when executed within the context of the memory database. Or have I got the syntax wrong, or I'm missing something?

Roy Lambert
Fri, Jan 22 2010 4:43 AMPermanent Link

Michael Reisch
Roy,

you´re right. This is my problem, EDB Error #700 is fired. I have at the moment no easy
way to move my finished projects out of the database. Any idea would be very welcome.

Michael
Fri, Jan 22 2010 6:10 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Did you miss the point that he wants to use LIKE across databases which
2.03b7 doesn't like. So me trying to create a new table in my memory
database using a table in nlh eg >>

Yep.  I fixed this for build 8, so you can now do this:

CREATE TABLE MyTable LIKE (MyOtherDatabase.MyOtherTable)

you can now even copy the structure of the Information schema tables:

CREATE TABLE MyTable LIKE (Information.Tables)

You still cannot use a database or schema qualifier on the target table
being created/altered/dropped, however.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Jan 22 2010 6:10 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< you´re right. This is my problem, EDB Error #700 is fired. I have at the
moment no easy way to move my finished projects out of the database. Any
idea would be very welcome. >>

My apologies for missing the LIKE.  See my response to Roy for the
resolution.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Jan 22 2010 7:57 AMPermanent Link

Michael Reisch
Tim,

thank you! When do you release Build 8? Is it in build 8 also possible to use parameters
in subqueries in joins?

Michael
Fri, Jan 22 2010 6:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< thank you! When do you release Build 8? >>

It should be available by this weekend.

<< Is it in build 8 also possible to use parameters in subqueries in joins?
>>

If you're talking about using parameters in derived tables, then you can do
that with Build 7.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image