Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

re-setting DB2 tables

Status
Not open for further replies.

Rambergs

Technical User
Mar 20, 2012
2
GB
I have a DB2 table that is constantly added to (via a GUI-based input application) on a regular, multi-user basis.

The table holds just one field per record but inputting new records results in the order being randomly spread out. While this does not matter in RDBM terms, it is untidy for the input process because input is done - a lot of the time - via a drop-down list.

What I need to do is to re-order this table (CHARTNEW) so that it is re-jigged to alphabetical order. As I don't know how to do this in SQL-speak I am exporting the table to an Excel file, sorting this into alphabetical order and then replacing CHARTNEW with the sorted version (via import back to DB2)

is there a way this can be done via an SQL thread?

Any help greatly appreciated thanks
 
if the order you wish to have them is one of the main indexes you can do it through the reorg utility - otherwise you can also do it through unload-sort-load.


but if it is not on an index then just add a order by to your selects and all is good

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top