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 > Newbie: How to pass data from database to other database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-05-06, 12:54
elmargaro elmargaro is offline
Registered User
 
Join Date: Jul 2006
Posts: 1
Newbie: How to pass data from database to other database

Hi guys im new in the informix world, i need to pass data from a table X in database A, to a table Y in database B, the fields are not equal so i need to do an insert (fields...) values(..)
i thought in write a stored procedure but i don't have a manual to learn (is difficult to find informix manuals ), how can i pass this data using just a SQL query or stored procedure?

can you give me a little sample?


Regards.
Reply With Quote
  #2 (permalink)  
Old 07-06-06, 04:10
nitin_math nitin_math is offline
Registered User
 
Join Date: Nov 2004
Posts: 143
Hi,

You can access the tables of other database with the following syntax:

select * from database_remote:table_remote

I gues, you can now easily write a SQL.

Bye

Nitin
Reply With Quote
  #3 (permalink)  
Old 07-10-06, 04:06
supinformix supinformix is offline
Registered User
 
Join Date: Apr 2004
Location: Brussels
Posts: 57
IBM store all manuals online :
http://publib.boulder.ibm.com/infoce.../v10/index.jsp

If your second database is on the same databaseserver you can use :
insert into table1 (col1, .. ) select col2,.. from db2:tab2 ;

If your second database is on another databaseserver (same or other hosts) you can use :
insert into table (col1, ..) select col2,.. from db2@server2:tab2 ;
and be sure your server2 is also referenced in the SQLhosts file your pointing at.

Another way is to unload from a specific select statement with : unload to 'file1' select col1, .. from tab1;
Move the file and reload them on the second database :
load from 'file' insert into tab2.

success,
__________________
Yves & Willy
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