Avatar of Shaunsmith
Shaunsmith
Flag for United States of America asked on

Convert an NClob to Character in Oracle

My requirement is to be able to do a distinct on a Table that has a Nclob

select distinct comment from finance_comments ;

Now since comment is a Nclob the DB does not allow me to use a distinct .

I was hoping to use "DBMS_LOB.SUBSTR" to convert it to chars .


SELECT distinct DBMS_LOB.SUBSTR(comments,4000,1)
FROM finance_comments

when I try to do this I get a 16:01:02  [SELECT - 0 row(s), 0.000 secs]  [Error Code: 6502, SQL State: 65000]  ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 1


Is this the right approch to this or is there a better way to be able to get distinct rows from
a table that has NClobs .
DatabasesOracle DatabaseSQL

Avatar of undefined
Last Comment
slightwv (䄆 Netminder)

8/22/2022 - Mon
nito8300

ASKER CERTIFIED SOLUTION
slightwv (䄆 Netminder)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck