Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


re-setting DB2 tables

re-setting DB2 tables

re-setting DB2 tables

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

RE: re-setting DB2 tables

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


Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close