|
|
|
|
|
|
| Author |
Message |
Rauf Sarwar *nix forums Guru
Joined: 03 May 2005
Posts: 353
|
Posted: Mon Feb 07, 2005 8:51 am Post subject:
Re: Converting CHAR to VARCHAR2
|
|
|
Zephyr wrote:
| Quote: | Hi,
I've inherited a database schema of Oracle 9i with some
char columns that can't be used from a GUI interface.
I need to convert these columns from char (5) to varchar2 (5).
OK, i can drop the constraints create new tables with the rigth
datatype, insert the tuples ... correct the old table and
erverything back.
Is there a possible other solution the convert the datatypes in an
easy way.
Thanks
Patrick
|
1) Drop indexes.
2) alter table table_name modify (column_name varchar2(5));
3) Remove right padding from the values that were created by char.
update table_name set column_name = rtrim(column_name);
4) Recreate indexes.
Regards
/Rauf |
|
| Back to top |
|
 |
Zephyr *nix forums beginner
Joined: 27 Jun 2005
Posts: 10
|
Posted: Mon Feb 07, 2005 7:39 am Post subject:
Converting CHAR to VARCHAR2
|
|
|
Hi,
I've inherited a database schema of Oracle 9i with some
char columns that can't be used from a GUI interface.
I need to convert these columns from char (5) to varchar2 (5).
OK, i can drop the constraints create new tables with the rigth
datatype, insert the tuples ... correct the old table and erverything back.
Is there a possible other solution the convert the datatypes in an easy way.
Thanks
Patrick |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 3:41 am | All times are GMT
|
|
Buy Anything On eBay | Movies download | Debt Consolidation | Looking for Credit Cards? | Modded Xbox
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|