Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clob to Varchar

Status
Not open for further replies.

yunomac

Technical User
Jan 21, 2002
1
US
Is there an Oracle function which will convert a Clob to Varchar? Is this possible to do?

Thanks for your time.
 
create table t1(c1 clob);
insert into t1 values('abcdefghijklmnopqrstuvwxyz');
set serverout on
declare
c_lob clob;
v_txt varchar2(4000);
begin
select c1 into c_lob from t1;
v_txt := dbms_lob.substr(c_lob, 4000, 1);
dbms_output.put_line(v_txt);
end;
/

Will produce a line with the alphabet insert into t1 above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top