LONG datatype
483527Dec 9 2007 — edited Dec 10 2007Hi
In the Oracle Database SQL Reference document LONG datatype is defined in Oracle Built-in
datatypes as follows:
<Character data of variable length up to 2 gigabytes, or 231 -1 bytes.>
But when I run the follwing pl/sql code I get the error ORA-06502: PL/SQL: numeric or value
error: character string buffer too small:
SQL> declare
s long;
begin
s:='';
for i in 1..1000 loop
s:=s||dbms_random.string('X',100);
end loop;
exception when others then
println('length s = '||length(s));
println(sqlerrm);
end; 2 3 4 5 6 7 8 9 10 11
12 /
length s = 32700
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.33
SQL>
Kind regards
Taoufik