Shaunsmith
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,4 000,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 .
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,4
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 .
Try this: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:367980988799
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.