Moving specific data between databases

Dear All,

I have 2 databases, There is a lot of data in both the databases, i would like to move some data from one database to the other. I would like to accept 2 parameters from the user, i.e. emplyee id & dept, on entering the 2 i will unload all the data from the tables to the flat files. Now i need to load this data from the flat files in to the other database. If the data exists in the new database it should update the data. Any workarounds on it. Thanks in advance.

Regards,

lloyd

Hai

It would be better if you provide us with more informations about your database, operating system and programing language(if any)...

Anyway...... Here are some solutions assuming that you have to move from mysql -> flat file -> postgres.... undex linux platform

To fetch data form mysql to a flat file.....
echo "select * from companies where eid=\"something\" and edept=\"something\"" | /usr/local/mysql/bin/mysql -uUSERNAME -pPASSWORD DB_NAME > foo.txt;

To import from flat file to postgres
echo "COPY table_name FROM filename" | psql USERNAME DB_NAME;

to import from a flat file to mysql you have a query called LOAD DATA...

I am not soo good in database... My query may have some errors... For your reference visit the help of LOAD DATA and COPY command...

Bye
:)Collins:)

Hi Collins,

Thanks for your prompt reply, my database is informix 9, and my os is sun solaris 8. Appreciate ur help.

Regards,

lloyd