View previous topic :: View next topic
|
Author |
Message |
Huzefa
New User
Joined: 05 Dec 2006 Posts: 83 Location: Bangalore
|
|
|
|
Hi All,
Assume I have a database DB10001. I have a table in this database named CREATOR.TABLE1. This Table has 10 columns.
What I have to achieve is to drop the existing table CREATOR.TABLE1 and recreate the table CREATOR.TABLE1 with 5 columns and with all the records from the dropped tables.
One option is
1. Unload the data
2. drop the table with 10 columns
3. create the table with 5 columns and
4. load the data.
I have more than 155331295 in the database and hence I feel this as a costly affair..
Can anybody give me some other option or solution |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
From manual says,
Quote: |
It is not possible to rearrange or delete columns in a table without dropping the entire table. You can, however, create a view on the table, which includes only the columns you want, in the order you want. This has the same effect as redefining the table |
|
|
Back to top |
|
|
Huzefa
New User
Joined: 05 Dec 2006 Posts: 83 Location: Bangalore
|
|
|
|
The issue here is not with the accessing of data but to save the DASD space and hence I need to have another table with 5 columns dropping the previous table |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Start the unload. . . .
Regardless of other suggestions you may receive, i suggest you will want a complete unload before you do anything else. Even if you have an image copy or volume backup, having the unloaded data is a good precaution. If it it too large for dasd, use cart/tape.
After the unload completes, if there have been no suggestions that will meet your request, do the drop, create, and reload of the selected data. |
|
Back to top |
|
|
|