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!

regarding conversion from CLOB to LONG datatype oracle 11g

Mohit MangalSep 24 2013 — edited Sep 25 2013

Hello sir,

I have some problem in code

I have one table template1 and it is having column col1 varchar2(100) primary key and second is col2 CLOB

I am executing the following code but its giving an error ORA-06502: PL/SQL: numeric or value error

Declare

v_temp LONG;

Begin

SELECT col2 INTO v_temp

FROM template1 WHERE col1='SANT' ;

EXCEPTION

WHEN OTHERS THEN

   DBMS_OUTPUT.PUT_LINE(SQLERRM);

END;

Note the size of col2 is 106369

If i change data type LONG to CLOB of variable v_temp , then it works.

My question is that,why is it giving an error(Actually Long size is 2GB and above col2 size is less than 2GB.)?

Thanks

Mohit

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2013
Added on Sep 24 2013
9 comments
1,974 views