- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to modify a NOT NULL column's data type?
Operating System - HP-UX
1754257
Members
3419
Online
108812
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-23-2002 06:07 PM
тАО01-23-2002 06:07 PM
how to modify a NOT NULL column's data type?
Hi,
I have a table, when described I got the table definition,
Name Null? Type
------------------------------- -------- ----
LOT_NO NOT NULL VARCHAR2(20)
BI_WRO_HOURS NOT NULL VARCHAR2(10)
and this talbe have data already, I need to change the data type of BI_WRO_HOURS from VARCHAR2(10) to NUMBER,
what is the best way to achieve this? or do I have to do exporting and importing of the table, or drop the table and recreate one and insert the data?
Thanks,
Jane
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2002 01:28 AM
тАО01-24-2002 01:28 AM
Re: how to modify a NOT NULL column's data type?
Hi
Since you're changing the column datatype, I think you'll not be able to do the export/import, as this requires identical tables.
Instead unload you table data using a script to create a *.csv file and a SQL*Loader controlfile.
Then truncate your table, and change the column.
Then use SQL*Loader to load the previous unloaded data. (Remember to thes the procedure befor performing on real data...)
Run the attached script like this:
sqlplus -s user/passwd @unload.sql table_name
Then load using:
sqlldr user/passwd control=table_name.ctl
Have fun!
Andreas
Since you're changing the column datatype, I think you'll not be able to do the export/import, as this requires identical tables.
Instead unload you table data using a script to create a *.csv file and a SQL*Loader controlfile.
Then truncate your table, and change the column.
Then use SQL*Loader to load the previous unloaded data. (Remember to thes the procedure befor performing on real data...)
Run the attached script like this:
sqlplus -s user/passwd @unload.sql table_name
Then load using:
sqlldr user/passwd control=table_name.ctl
Have fun!
Andreas
Only by ignoring what everyone think is important, can you be aware of what everyone ignores!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2002 03:30 PM
тАО01-24-2002 03:30 PM
Re: how to modify a NOT NULL column's data type?
Andreas,
Thanks for the import and export reminder, I just create a temporary table and copy the data over, truncate the original table and modify the column.
Regards,
Thanks for the import and export reminder, I just create a temporary table and copy the data over, truncate the original table and modify the column.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2002 12:08 AM
тАО01-25-2002 12:08 AM
Re: how to modify a NOT NULL column's data type?
Aaahhhh
I'm so In Love with the SQL*Loader, that the easy way skipped my mind altogether.
Andreas
I'm so In Love with the SQL*Loader, that the easy way skipped my mind altogether.
Andreas
Only by ignoring what everyone think is important, can you be aware of what everyone ignores!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP