Copying data from one informix database to another

Asked By 30 points N/A Posted on -
qa-featured

How can I copy a data from one informix database to another without using LOAD? Is there a script that I can use in doing this?

SHARE
Answered By 0 points N/A #115300

Copying data from one informix database to another

qa-featured

From one server you have to UNLOAD data to a text file, let's say data.txt (example a table with 2 columns and 2 rows)

Content of data.txt will be

1111|AAAA

2222|BBBB

Now using awk or insert manually  and replace pipe (default separator) depending on number of rows.

The data.txt file should content the following:

INSERT INTO table_name(Column_A, Column_B) VALUES('1111','AAAA');

INSERT INTO table_name(Column_A, Column_B) VALUES('2222','BBBB');

Now rename data.txt TO data.sql

Go to iSQL -> Query Language -> Chose Database -> Script -> Choose data.sql

and Run.

If you are avoiding LOAD because of an error, in my experience is because:

1.- Index corruption. Drop Table and create it again without indexes. Load DATA. Create Indexes.

2.- Number of data does not match number of columns. Use Pipe ( | ) as a separator.

3.- End of line. DOS files and UNIX files are different, check End-of-Line terminator.

 

Related Questions