IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

moving table into different database


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts What database does Jobtrac use CA Products 4
Search our Forums:

Back to Top