Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread Have EDB some functions for copy table between DB-s? (Not replication)
Tue, Jan 26 2010 2:47 AMPermanent Link

durumdara
Hi!

We want to port our apps to EDB.

Our apps are many times using local copies of the tables for speeding up the long processes (subst. slow network).
For this we used FieldDefs.Assign/CreateTable. This was very simple.

I don't see any function/procedure in the description/manual that can copy table between databases, or what can render
table to SQL script can be use for local table creation.

Possible I missed it.

Do you have same thing to create table before "batchmove" the interesting data to another database (without rewrite
some "reverse sql" tool)?

Thanks:
 dd
Tue, Jan 26 2010 4:06 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

durumdara


As long as the databases share the same session you can move data between them with simple sql statements eg INSERT & UPDATE. You can even create a local table and populate it using CREATE TABLE AS WITH DATA.

The trick is to preface the table name with the database name.

If they don't share the session (which I guess they wouldn't do if you have many users all creating their own local copies) then you could use the replication stuff (I haven't so can't say much but check out http://www.elevatesoft.com/articles?action=view&articleno=3) or sql EXPORT / IMPORT

Roy Lambert [Team Elevate]
Tue, Jan 26 2010 4:10 AMPermanent Link

Uli Becker
durumdara ,

> Do you have same thing to create table before "batchmove" the interesting data to another database (without rewrite
> some "reverse sql" tool)?

Try this:

create table TEST as select * from Database2.MyTable with no data

Regards Uli
Tue, Jan 26 2010 4:11 AMPermanent Link

Uli Becker
Roy,

sorry, didn't see your reply.

Uli
Tue, Jan 26 2010 5:15 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Uli


Don't apologise when you're trying to help Smiley

Roy Lambert
Wed, Jan 27 2010 3:20 AMPermanent Link

durumdara
Roy Lambert wrote:
<<As long as the databases share the same session you can move data between them with simple sql statements eg
INSERT & UPDATE. You can even create a local table and populate it using CREATE TABLE AS WITH DATA.
The trick is to preface the table name with the database name.>>

Dear Roy!

And without data, only the table creation SQL?
How can I get the table creation information?

For example: IB/FB stored this. In PGAdmin you can see the re-generated table creation SQL.

Because I want to make the table without moving data, and between diff. sessions, but I don't want to replicate, because
this is a temp table only. And Export do not restore the table structure.

Thanks for your help:
  dd
Wed, Jan 27 2010 5:06 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

durumdara


WITHOUT DATA

Roy Lambert [Team Elevate]
Wed, Jan 27 2010 6:34 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< And without data, only the table creation SQL? How can I get the table
creation information? >>

There are two ways you can do so:

1) CREATE TABLE MyTable
(LIKE MyOtherDatabase.MyOtherTable)  >> only available in 2.03 B8 coming up
shortly

2) CREATE TABLE MyTable AS
SELECT * FROM MyOtherDatabase.MyOtherTable WITHOUT DATA

<< For example: IB/FB stored this. In PGAdmin you can see the re-generated
table creation SQL. >>

Just drag any table in the EDB Manager and drop it in the editor of a new
SQL statement window (File/New/Statement), and you'll see the table DDL that
you can save, etc..  You can do that with any object in the EDB Manager from
the database level down (tables, views, procedures, etc.).

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Jan 27 2010 2:10 PMPermanent Link

"Malcolm"
Tim Young +AFs-Elevate Software+AF0- wrote:

+AD4- Just drag any table in the EDB Manager and drop it in the
editor of
+AD4- a new SQL statement window (File/New/Statement), and you'll see
the
+AD4- table DDL that you can save, etc..  You can do that with any
object
+AD4- in the EDB Manager from the database level down (tables, views,
+AD4- procedures, etc.).

Aaaargh+ACE-  I wish I had known that last week+ACE-

--
Image