Re: how to copy tables between databases
Posted in 1998
Lijun Feng wrote:
>
> Hi Experts,
>
> I'm new to Informix. Here is one question:
>
> We have a database which has 10 tables including hundreds records. We
> want to transfer or copy 6 of the 10 tables to another database, we want
> to keep both table structure and records. Is there any easy way to do
> this? In DBAccess?
Just brute force:
1) Use dbschema to get a schema of the 6 tables.
2) Re-create them in the new database.
3) Copy the data from the original database to the new one via:
a) INSERT INTO ... SELECT * FROM ...
b) UNLOAD TO ...; LOAD FROM ...;
c) Get my dbcopy utility from the IIUG Software Repository (file:
utils2_ak) or some other similar copy program. Dbcopy will be
slightly faster than INSERT INTO ... SELECT * FROM and it is
easier and more efficient to run multiple copies of dbcopy than
of dbaccess.
Art S. Kagel