I have the following sql trying to query our database. Removing the Clob field (a.description) I am successful. But I need the Clob field (a.description). Here is my current sql
select a.id_number, a.id_owner, MAX (n.next_action_required)
KEEP (DENSE_RANK LAST ORDER BY n.modified_date),
MAX (n.modified_date) KEEP (DENSE_RANK LAST ORDER BY n.modified_date)
from table1 a, table2 n
where a.id_number = n.id_number
group by a.id_number, a.id_owner
I tried the following which works sometimes but not always because the Clob field (a.description)'s length varies; anywhere from 10 characters up to 12,000 characters. I get some blanks with the following and some where text is cut off. I may not be writing the dbms_lob.substr function correct.
select a.id_number, a.id_owner, MAX (n.next_action_required)
KEEP (DENSE_RANK LAST ORDER BY n.modified_date),
MAX (n.modified_date) KEEP (DENSE_RANK LAST ORDER BY n.modified_date) , DBMS_LOB.SUBSTR (a.description, 8001, 10000)
from table1 a, table2 n
where a.id_number = n.id_number
group by a.id_number, a.id_owner, DBMS_LOB.SUBSTR (a.description, 8001, 10000)
Please help. Thank you,