RE: [Q] shrink varchar2 size and truncate data????

From: Mercadante, Thomas F (LABOR) <>
Date: Tue, 21 Oct 2008 13:34:08 -0400
Message-ID: <ABB9D76E187C5146AB5683F5A07336FFE093D9@EXCNYSM0A1AJ.nysemail.nyenet>

How about this?    

create table tomtest(col1 varchar2(6))

insert into tomtest values('abcdev')

update tomtest

set col1=substr(col1,1,4);

alter table tomtest modify(col1 varchar2(4));      

[] On Behalf Of dba1 mcc Sent: Tuesday, October 21, 2008 1:17 PM
Subject: [Q] shrink varchar2 size and truncate data????  

we have a table has a field define as "varchar2(2000)", we tried to change size from varchar2(2000) TO VARCHAR2(1000). dUE TO SOME RECORDS DATA LARGE THAN 1000.   I can use following sql statemnet to find which records > 1000 characters, but how can I truncate data larger than 1000 characters?  

select id, length(INSTRUCTIONS) from functions where length(INSTRUCTIONS) >=1000;  

Received on Tue Oct 21 2008 - 12:34:08 CDT

Original text of this message