Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> How to convert from long to varchar - SOLVED

How to convert from long to varchar - SOLVED

From: <Cherie_Machler_at_gelco.com>
Date: Tue, 5 Dec 2000 12:37:17 -0600
Message-Id: <10701.123701@fatcity.com>


We spent more time researching converting our longs to varchar.
Found the following esoteric command on a metalink forum SET COPYTYPECHECK OFF With that I can just do a simply copy within SQL*Plus from the original table to a temp table that has the old long column defined as varchar2(255). Then I dropped the old table, renamed the new table to the original name and replaced the constraints. Much simpler than the PL/SQL solution we were looking at from RevealNet.

# This script can be used from
# sqlplus to "convert" long to varchar2

SET COPYTYPECHECK OFF
set long 255
copy to userid/password_at_SID -
insert temp_table -
using select * from original_table;

Hope that helps someone

Cherie
Cherie Machler
Gelco Information Network

---------------------- Forwarded by Cherie Machler/GELCO on 12/05/2000 01:29 PM
---------------------------


Cherie Machler
12/05/2000 07:21 AM

To: ORACLE-L_at_fatcity.com
cc:

Subject: How to convert from long to varchar? (Document link: Cherie Machler)

We recently migrated from 7.3.4 to 8.1.5. A developer wants me to convert a column in a table that is a long to varchar(255). What is the best way to do this.

Documentation shows changing from
long to LOB but I don't see anything about changing from long to varchar. Received on Tue Dec 05 2000 - 12:37:17 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US