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

BMC UNLOAD sorting w.r.t primary key


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinuthna2004

New User


Joined: 30 Dec 2005
Posts: 6

PostPosted: Fri Oct 05, 2007 8:19 am
Reply with quote

We need to UNLOAD todays data from table-1 and LOAD into table-2 (this holds 1 weeks worth data). i.e after UNLOADing into a file, we will LOAD that file to table-2?

While UNLOADing data from table-1 using BMC utility, do we need to use 'ORDER BY' clause on SELECT statement to sort the primary keys?

My doubt is. Tables are defined with primary key always. So when we are loading, it will insert the rows into table taking primary key constraits. So why to use ORDER BY clause? Or will it take longer time for rearranging the loaded rows if ORDER BY clause is not given?
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 275
Location: Bang,iflex

PostPosted: Fri Oct 05, 2007 10:39 am
Reply with quote

Hi Vinutha......

ORDER BY statement gives you in which order the table data will be displayed in ASCENDING order or DESCENDEING order u must knw that default is ASCENDING order respective of the primary key definition.

I think u will be knowing that ASC or DESC parameter is given with INDEX key definition which helps the query to manipulate quickly.

If the table_2 is created in such a way, in which it contains all the attributes of table_1 sucha as data type, primary key definition as same as table_1 index should be created on the primary key to boost up your query. INDEX key will reduce your time and tune your query accodingly.


Regard's

Vasanth........ icon_smile.gif
Back to top
View user's profile Send private message
vinuthna2004

New User


Joined: 30 Dec 2005
Posts: 6

PostPosted: Wed Oct 10, 2007 10:07 pm
Reply with quote

Thanks for your advice. It was helpful
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 Remote Unload of CLOB Columns DB2 6
No new posts Multiple table unload using INZUTILB DB2 2
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts changing defaults in db2 admin - Unlo... DB2 0
Search our Forums:

Back to Top