How to cast a clob to varchar

Database
Enthusiast

How to cast a clob to varchar

I have  a clob cloumn called mytext

select substr(mytext, 1, 500) from my table

Still substr is returned as clob because it is taking me to store this reuslt in some file in Tredata Studio. How can I get a substr as varchar. Have not been succesful in finding the answer googling.

Thanks.

1 REPLY
Enthusiast

Re: How to cast a clob to varchar

I figured out it myself.

select cast(substr(mytext, 1, 500) AS VARCHAR(500)) as mytext2