Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

moving table into different database

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Tue Mar 07, 2006 2:23 pm    Post subject: moving table into different database
Reply with quote

Hi All

One of my tables
BLEMP exists in DB001 database ( which has 2 millon records)

i need to create a new table
BLEMP in DB000 database and move the data of DB001 database into it


I am thinking of below statement
insert into BLemp as slect * from blemp(DB001 database)
But i am not sure of can we move data into 2 different databases wth the above statement

Can any one suggest the best possible approach


Regards
Prasad
Back to top
View user's profile Send private message

ragshere

New User


Joined: 20 Dec 2004
Posts: 70

PostPosted: Tue Mar 07, 2006 6:51 pm    Post subject: Re: moving table into different database
Reply with quote

Hi,

1. You can not create same table name (under same owner) 2 times even though they will reside in different databases.

2. If you created them under different owner, You can not use insert statement for inserting 2 million records.

You have to unload and load the data.Insert will not bear that much volume and system log will full because of this insert. so you must use UNLOAD and LOAD.


Thanks
Rags
Back to top
View user's profile Send private message
senthilssg

New User


Joined: 09 Dec 2005
Posts: 64
Location: USA

PostPosted: Wed Mar 08, 2006 2:28 pm    Post subject:
Reply with quote

Hi ,

create the new table with name BLEMP1 in db DB000 with same owner .

After that u can use,


INSERT INTO BLEMP1 SELECT * FROM BLEMP;

Then u if u dont want the table BLEMP in DB001 , u can drop the table and then rename the new table BLEMP1 to BLEMP

RENMAE TABLE BLEMP1 TO BLEMP



correct me if i am wrong

Thanks and Regards,
Senthil
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts IMS Database backup info ashek15 IMS DB/DC 14 Wed Nov 16, 2016 5:29 am
No new posts Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us