How to read a SQL*plus LONG table column value in PL/SQL where data length exceeds 32K
I am trying to read the value of DBA_VIEWS.TEXT in PL/SQL. the TEXT column has a long datatype and the TEXT_LENGTH is 38324
set serveroutput on size 1000000
declare
v1 long;
begin
select text into v1 from dba_views where view_name='PQH_COPY_ENTITY_ATTRIBS_DFV';
end;
/
When v1 has a datatype LONG the following exception is being raised. I presume this is because a PL/SQL LONG datatype has a limit of 32K
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 4
When changing the datatype of v1 to either CLOB or BLOB, the following error is raised
set serveroutput on size 1000000
declare
v1 long;
begin
select text into v1 from dba_views where view_name='PQH_COPY_ENTITY_ATTRIBS_DFV';
end;
/
When v1 has a datatype LONG the following exception is being raised. I presume this is because a PL/SQL LONG datatype has a limit of 32K
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 4
When changing the datatype of v1 to either CLOB or BLOB, the following error is raised
0