Home » SQL & PL/SQL » SQL & PL/SQL » Long field to varchar datatype
Long field to varchar datatype [message #365180] Wed, 25 March 1998 15:09 Go to next message
claudine
Messages: 5
Registered: March 1998
Junior Member
Hello,
I need to copy the contain of a long field to varchar field. Oracle keeps generating mismatch data type.
Did try to use subsrtring but didn't help either.
Is it possible to do? If not any suggestion on how I can move the data from the long type to varchar?

Thanks.
Re: Long field to varchar datatype [message #365182 is a reply to message #365180] Wed, 25 March 1998 19:12 Go to previous messageGo to next message
Sameer
Messages: 60
Registered: March 1998
Member
U can do this but only 32767 bytes data can be copied. Use a PL/SQL block and select the LONG column into a VARCHAR2(32767) variable. Using this way u can move the data from LONG to VARCHAR. 32767 is the upper limit, so if the LONG column contains more than that ... ???

Sam
Re: Long field to varchar datatype [message #365185 is a reply to message #365182] Fri, 27 March 1998 15:59 Go to previous message
Jon Nordby
Messages: 4
Registered: March 1998
Junior Member
Try using the TO_CHAR function:

insert into varcharcolumn
select to_char(longcharcolumn)
from longchartable;
Next Topic: Bitmap index creation problem
Goto Forum:
  


Current Time: Thu Mar 28 17:20:49 CDT 2024