How to transfer the table & its data from one database to another database

Hi

I need to transfer the records & strcuture of the table from
Database1 to Database2.
It is like export/import functionality SQL server. Is there
any way to do like this in ASA 8.0.2

B'cos most of the time i need to transfer some of the
objects with data from one database to another.

Please help me in this regard

Thanks in advance
Shankar
0
shankar
8/13/2003 10:03:00 AM
sybase.sqlanywhere.general 32637 articles. 22 followers. Follow

2 Replies
963 Views

Similar Articles

[PageSpeed] 11
Get it on Google Play
Get it on Apple App Store

Hi,

I am doing this through a few ISQL statements e.g.

(connected to db1)
SELECT * FROM CUSTOMERS;
OUTPUT TO "c:\\tmp\\customers.txt" FORMAT ASCII DELIMITED BY
'\x09';

SELECT * FROM SUPPLIERS;
OUTPUT... etc. for all the tables you need

(connected to db2)
INPUT INTO CUSTOMERS FROM "c:\\tmp\\customers.txt" FORMAT
ASCII DELIMITED BY '\x09';
INPUT INTO SUPPLIERS FROM "c:\\tmp\\suppliers.txt" FORMAT
ASCII DELIMITED BY '\x09';

This works fine if you only need a few tables and their
data.

Maybe others have better ways of doing this.

HTH
John

>
> I need to transfer the records & strcuture of the table
> from Database1 to Database2.
> It is like export/import functionality SQL server. Is
> there any way to do like this in ASA 8.0.2
>
> B'cos most of the time i need to transfer some of the
> objects with data from one database to another.
>
> Please help me in this regard
>
> Thanks in advance
> Shankar
0
Vanleeuwe
8/13/2003 11:29:36 AM
This of course works if your db2 has the same table
structure as your db1.  If you have an empty db2 or the
tables need to be created , i suggest unloading structure of
db1 and reloading this structure into db2.

HTH
> Hi,
>
> I am doing this through a few ISQL statements e.g.
>
> (connected to db1)
> SELECT * FROM CUSTOMERS;
> OUTPUT TO "c:\\tmp\\customers.txt" FORMAT ASCII DELIMITED
> BY '\x09';
>
> SELECT * FROM SUPPLIERS;
> OUTPUT... etc. for all the tables you need
>
> (connected to db2)
> INPUT INTO CUSTOMERS FROM "c:\\tmp\\customers.txt" FORMAT
> ASCII DELIMITED BY '\x09';
> INPUT INTO SUPPLIERS FROM "c:\\tmp\\suppliers.txt" FORMAT
> ASCII DELIMITED BY '\x09';
>
> This works fine if you only need a few tables and their
> data.
>
> Maybe others have better ways of doing this.
>
> HTH
> John
>
> >
> > I need to transfer the records & strcuture of the table
> > from Database1 to Database2.
> > It is like export/import functionality SQL server. Is
> > there any way to do like this in ASA 8.0.2
> >
> > B'cos most of the time i need to transfer some of the
> > objects with data from one database to another.
> >
> > Please help me in this regard
> >
> > Thanks in advance
> > Shankar
0
Vanleeuwe
8/13/2003 11:31:02 AM
Reply: