Here's an example - first we show how it fails (TEXT is a 'long' in DBA_VIEWS)
SQL> select length(text)
2 from dba_views
3 where view_name = 'DBA_OBJECTS';
select length(text)
*
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected CHAR got LONG
For a one-off requirement, we can simply clone the table converting to LOB
SQL> create table DUMMY as
2 select to_lob(text) c
3 from dba_views
4 where view_name = 'DBA_OBJECTS';
Table created.
SQL> select length(c) from dummy;
LENGTH(C)
----------
3244
If that is not possible or appropriate, then there's a trick I learned from a friend Adrian Billington, to extract the data as XML, then use that
SQL> WITH xml AS (
2 SELECT XMLTYPE(
3 DBMS_XMLGEN.GETXML(q'{SELECT * FROM dba_views where view_name = 'DBA_OBJECTS'}')
4 ) AS xml
5 FROM dual
6 )
7 , parsed_xml AS (
8 SELECT extractValue(xs.object_value, '/ROW/TEXT') AS text_as_string
9 FROM xml x
10 , TABLE(XMLSEQUENCE(EXTRACT(x.xml, '/ROWSET/ROW'))) xs
11 )
12 SELECT length(text_as_string)
13 FROM parsed_xml
14 /
LENGTH(TEXT_AS_STRING)
----------------------
3244
Hope this helps.