Home » SQL & PL/SQL » SQL & PL/SQL » Changing datatype
Changing datatype [message #19491] Thu, 21 March 2002 15:38 Go to next message
Kevin Chapman
Messages: 2
Registered: March 2002
Junior Member
Is it possible to change a column's datatype from varchar2 to date?
Re: Changing datatype [message #19493 is a reply to message #19491] Thu, 21 March 2002 18:50 Go to previous messageGo to next message
nash
Messages: 10
Registered: February 2002
Junior Member
Yes, it is possible to change a column's datatype from varchar2 to date

alter table

modify <column_name> <varchar2(10) <date>

-------------
HTH

nash
Re: Changing datatype [message #19495 is a reply to message #19491] Thu, 21 March 2002 18:56 Go to previous messageGo to next message
Kevin Chapman
Messages: 2
Registered: March 2002
Junior Member
Nash,

Thanks for the quick reply. What I also meant to ask for was an example, anywhere you could point me?
Re: Changing datatype [message #19498 is a reply to message #19491] Thu, 21 March 2002 19:17 Go to previous messageGo to next message
nash
Messages: 10
Registered: February 2002
Junior Member
SQL > create table temp
(test varchar2(10));

---------
SQL > Table created
---------

SQL > alter table temp
modify test varchar2(10) date;

----------
SQL > Table altered
----------

--------------------------------
HTH

nash
Re: Changing datatype [message #19500 is a reply to message #19491] Thu, 21 March 2002 19:31 Go to previous message
hanu
Messages: 21
Registered: March 2002
Junior Member
If the data in that column is null then you can modify.
alter table table_name modify (column_name date);

Thanks.
Previous Topic: Domin index
Next Topic: UPDATE TABLE FROM ANOTHER
Goto Forum:
  


Current Time: Thu May 09 20:15:50 CDT 2024