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 > copying table from 1 db to another

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-04-07, 14:19
gkavesh gkavesh is offline
Registered User
 
Join Date: Nov 2003
Posts: 5
copying table from 1 db to another

I have a 'live' & 'test' version of the same db. One called
live & one called test.

I have a table on the live side that I need to copy over to the 'test' side.
For the life of me I can't figure out the informix sql sytax.

seems like
create table ol_train.ren_option_invite as select * from ol_live.ren_option_invite

where ol_live is the naming convention of the live db instance & ol_train isthe name of the training environment. Seems like this should work but nope it doesn't.

I'm obviously missing something obvious but have no idea what it is.

Thank you in advance.

Gina
Reply With Quote
  #2 (permalink)  
Old 06-05-07, 01:06
ladwig ladwig is offline
Registered User
 
Join Date: May 2002
Location: Osnabrueck Germany
Posts: 59
Hi,
what about onunload and onload, have to be the same DB-Version.

onunload -t table.onu ol.livewner.table_name

load back in the second DB

onload -t table.onu ol.trainwner.table_name
__________________
Juergen Ladwig
Reply With Quote
  #3 (permalink)  
Old 06-05-07, 11:29
mjldba mjldba is offline
Registered User
 
Join Date: Dec 2003
Location: North America
Posts: 139
Different ways to do this & it's been a while since I've done this, previous example using unload and load works well.

To do this in a single step, I think you must specify the DB name@instance namewner of the DB in single quotes.table name of the table you're selecting data from.

This assumes the target table in the test DB already exists and whatever SQL tool you're using is accessing the testDB.

Example: insert into ren_option_invite
select * from live@prod-instance:'sysadm'.ren_option_invite
Reply With Quote
  #4 (permalink)  
Old 06-05-07, 13:37
gkavesh gkavesh is offline
Registered User
 
Join Date: Nov 2003
Posts: 5
thanks

that points me in the right direction.
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