dbTalk Databases Forums  

How to copy a table from one database to another.

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss How to copy a table from one database to another. in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Deepali
 
Posts: n/a

Default How to copy a table from one database to another. - 11-13-2009 , 10:43 AM






How can we copy a table from one database to another
database in ASA 7.

Reply With Quote
  #2  
Old   
Bofcilo
 
Posts: n/a

Default Re: How to copy a table from one database to another. - 11-16-2009 , 02:51 AM






On Nov 13, 5:43*pm, Deepali wrote:
Quote:
How can we copy a table from one database to another
database in ASA 7.
you can use remote servers. Remote servers in ASA 7 can be any ODBC
existing on PC. ASA 7 database which connect to remote servers and
ODBC "where" connect must be on same machine, but ODBC can reference
any server visible to that PC. In short, start both database on
separate ASA 7 server. Create ODBC for each database. With sybase
central at destination database create remote servers (parameter
"dsn=ODBC_source") where ODBC_source is dsn of soruce database. Under
remote server, create proxy table, and that is link to the table from
source. After that you can use proxy table as any table existing in
destination database. Execute command "insert into table_1 select *
from table_1_px". table_1 is name in destination database, table_1_px
is proxy name in destination of table from source database.

If you wish to copy table from one database to another, and
destination table does not exists.... that is not possible in ASA 7. I
found in SA10 version syntax of select command with INTO TABLE clause,
which create table and copy data at same time.
We are using delphi and there is one utility datapump.exe.

Reply With Quote
  #3  
Old   
Deepali
 
Posts: n/a

Default Re: How to copy a table from one database to another. - 11-17-2009 , 05:12 AM



Thank you for replying Bofcilo..

Quote:
On Nov 13, 5:43*pm, Deepali wrote:
How can we copy a table from one database to another
database in ASA 7.

you can use remote servers. Remote servers in ASA 7 can be
any ODBC existing on PC. ASA 7 database which connect to
remote servers and ODBC "where" connect must be on same
machine, but ODBC can reference any server visible to that
PC. In short, start both database on separate ASA 7
server. Create ODBC for each database. With sybase central
at destination database create remote servers (parameter
"dsn=ODBC_source") where ODBC_source is dsn of soruce
database. Under remote server, create proxy table, and
that is link to the table from source. After that you can
use proxy table as any table existing in destination
database. Execute command "insert into table_1 select *
from table_1_px". table_1 is name in destination database,
table_1_px is proxy name in destination of table from
source database.

If you wish to copy table from one database to another,
and destination table does not exists.... that is not
possible in ASA 7. I found in SA10 version syntax of
select command with INTO TABLE clause, which create table
and copy data at same time. We are using delphi and there
is one utility datapump.exe.

Reply With Quote
  #4  
Old   
Phil Harris
 
Posts: n/a

Default Re: How to copy a table from one database to another. - 11-17-2009 , 11:23 AM



Assuming both databases are on the same machine you could
use unload / load

Much faster than remote servers.


Quote:
Thank you for replying Bofcilo..

On Nov 13, 5:43*pm, Deepali wrote:
How can we copy a table from one database to another
database in ASA 7.

you can use remote servers. Remote servers in ASA 7 can
be any ODBC existing on PC. ASA 7 database which connect
to remote servers and ODBC "where" connect must be on
same machine, but ODBC can reference any server visible
to that PC. In short, start both database on separate
ASA 7 server. Create ODBC for each database. With sybase
central at destination database create remote servers
(parameter "dsn=ODBC_source") where ODBC_source is dsn
of soruce database. Under remote server, create proxy
table, and that is link to the table from source. After
that you can use proxy table as any table existing in
destination database. Execute command "insert into
table_1 select * from table_1_px". table_1 is name in
destination database, table_1_px is proxy name in
destination of table from source database.

If you wish to copy table from one database to another,
and destination table does not exists.... that is not
possible in ASA 7. I found in SA10 version syntax of
select command with INTO TABLE clause, which create
table and copy data at same time. We are using delphi
and there is one utility datapump.exe.

Reply With Quote
  #5  
Old   
Breck Carter [TeamSybase]
 
Posts: n/a

Default Re: How to copy a table from one database to another. - 11-18-2009 , 02:06 PM



Are you talking about the schema (the CREATE TABLE) or the data?

I assume it's the data.

Is this a one-time process, or do you want to do this on a regular
basis?

Is there a large amount of data, or not?

Are the two databases running on the same computer, or on different
computers?

These are factors to be considered when choosing between proxy tables
(always flexible, sometimes slow) and UNLOAD/LOAD (sometimes awkward,
always fast).

Breck



On 13 Nov 2009 08:43:38 -0800, Deepali wrote:

Quote:
How can we copy a table from one database to another
database in ASA 7.
--
Breck Carter - Blog: http://sqlanywhere.blogspot.com/

SQLA questions and answers: http://sqla.stackexchange.com

RisingRoad helps SQL Anywhere developers make better databases
http://www.risingroad.com/
Breck.Carter at gmail

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.