Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Converting LONG to NUMERIC
cal.pampa_at_usa.net wrote ...
Hi Cristian,
> I made a mistake when defining one Oracle table: defined one of its
columns as
> being of type LONG when it really should have been numeric. I thought
"LONG"
> stood for "LONG INTEGER" and later learned it meant a string up to 2 GB
in
> size.
> Now the table has over 100,000 records and I wish to convert the data
type of
> that column and keeping the data in the process...
> What I tried, using SQL-Plus:
> Creating a new table with the correct structure and populating it with
the
> INSERT INTO statement. But that failed, "INCORRECT USE OF LONG DATA
TYPE".
There are two approaches.
The easy one (tested under 8.0.3). This will work if ALL values in that LONG column are numbers:
The other method:
This will be much faster than Access, and more reliable.
Chris
![]() |
![]() |