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 > DB2 > Urgent...... Please help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-29-09, 00:39
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Urgent...... Please help

Hi Experts,

I have two schema in one database and all the tables are same in both schema with different data.I need to create another schema in which the all the tables have to be same but i need to view data from the other two schema that is in the third schema the tables should contain data from both the schema together.How can i achieve this?

Please help me.

Thanks in Advance.
Reply With Quote
  #2 (permalink)  
Old 06-29-09, 02:36
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
You can create VIEWs with UNION ALL for third schema, like this:

CREATE VIEW third_schema.table_x AS
SELECT * FROM first_schema.table_x
UNION ALL
SELECT * FROM second_schema.table_x
Reply With Quote
  #3 (permalink)  
Old 06-29-09, 06:45
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Thanks Tonkuma
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