If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Moving data from one database to other

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-29-04, 09:28
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Moving data from one database to other

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
Reply With Quote
  #2 (permalink)  
Old 09-30-04, 07:58
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Hi Lloyd,

I suggest that create on remote database the table type RAW, next run INSERT-SELECT, next use START VIOLATION TABLE FOR, for extract dupicate rows and create definitive table.

Gustavo.
Reply With Quote
  #3 (permalink)  
Old 10-01-04, 02:49
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Hi Gustavo,

Thanks for your feedback, but i want to move only specific data from tables in one database to another tables in another database. I will be accepting the dbname, employee id and dept. id from the user, based on that i will be unloading data from all the tables in to a flat file. Now i have to check whether these data exists in the other database, if not then i will hve to load it into the tables of the other database. Please advice.

Regards,

lloyd
Reply With Quote
  #4 (permalink)  
Old 10-01-04, 09:48
artemka artemka is offline
Registered User
 
Join Date: May 2004
Location: New York
Posts: 248
Create the "dummy" tables, load the data in to them and then create a stored procedure to insert or update the record based on its existance in the production tables.
Reply With Quote
  #5 (permalink)  
Old 10-01-04, 10:30
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Hi Lloyd

I agree with Armteka, you can create a table type RAW, this not loging generate, then match the corresponding rows.

Gustavo.
Reply With Quote
  #6 (permalink)  
Old 10-01-04, 13:40
bull_abraham bull_abraham is offline
Registered User
 
Join Date: Feb 2004
Posts: 32
Create two HPL jobs(Unload from existing Db and Load to new Db). You can
us the pipe to send it to a named/unnamed unix pipe there by avoiding the i/o on the FS.

THere is also another way, but I have forgotten the specifics. You can create a "Load" job and call the "Unload" job from within this in HPL.

-Abraham
Reply With Quote
  #7 (permalink)  
Old 10-03-04, 23:30
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Hi Guys,

Thank you all for your feedback, i will work on your suggesstions.

Regards,

lloyd
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On