Message-Id: <10563.112495@fatcity.com> From: VenkataRamana_Muthumula Date: Thu, 20 Jul 2000 11:07:58 +0530 Subject: Long to Varchar2 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01BFF20C.A5D576E0 Content-Type: text/plain Hi Jain, First create table ***************************** create table long2varchar2 (name varchar2(30), condition varchar2(2000) Then create and run the following procedure create or replace procedure long2varchar AS begin declare name varchar2(30); condition varchar2(2000); cursor long_cursor is select * from user_constraints; long_value long_cursor%ROWTYPE; begin for long_value in long_cursor loop name := long_value.constraint_name; condition := long_value.search_condition; insert into long2varchar2 values (name,condition); end loop; end; end; / **************************************************************************** ********* ---------- From: Jain Rahul [SMTP:Rahul.Jain@sisl.co.in] Sent: Thursday, July 20, 2000 10:45 AM To: Multiple recipients of list ORACLE-L Subject: Long to Varchar2 Hi List, Can anyone tell me the way to convert a LONG column to VARCHAR2 ? Actually, I need to select the 'SEARCH_CONDITION' (Long) column from user_constraints and insert it in one of my own table in a varchar2(2000) column. Any help in this regard is appreciated. RJ -- Author: Jain Rahul INET: Rahul.Jain@sisl.co.in Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). ------_=_NextPart_001_01BFF20C.A5D576E0 Content-Type: text/html Content-Transfer-Encoding: quoted-printable Long to Varchar2

Hi Jain,

First create table
*****************************
create table long2varchar2
 (name varchar2(30),
 condition varchar2(2000)

Then create and run the following = procedure

create or replace procedure = long2varchar
AS
begin
declare
name varchar2(30);
condition varchar2(2000);
cursor long_cursor is select * from = user_constraints;
long_value = long_cursor%ROWTYPE;
begin
for long_value in long_cursor
loop
name   :=3D = long_value.constraint_name;
condition :=3D = long_value.search_condition;
insert into long2varchar2
values (name,condition);
end loop;
end;
end;
/
*********************************************************= ****************************