Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

LONG datatype

483527Dec 9 2007 — edited Dec 10 2007
Hi

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 7 2008
Added on Dec 9 2007
10 comments
980 views