I was trying to get a LONG column into a VARCHAR2(32767) column in PL/SQL block. Then while trying to use functions like SUBSTR, LENGTH on the varchar2 variable, I am getting this error. How to overcome this ?
Ver : 8.0.6
Printable View
I was trying to get a LONG column into a VARCHAR2(32767) column in PL/SQL block. Then while trying to use functions like SUBSTR, LENGTH on the varchar2 variable, I am getting this error. How to overcome this ?
Ver : 8.0.6
Certainly it will be an error as the max size a varchar could hold is only 4000. In V8 I presume it to be of 2000 (not suer!)
Sam
That is the limit for a VARCHAR2 "column". For a varchar2 "variable" in pl/sql block, 32767 is okay.
Yes 32K is the block limit for the varchar2. But in your case what happens is that when you pass the data to a SUBSTR or LENGTH function which would use the SELECT internally to get the results. Since the SELECT has a cap of 4000 on varchar2 datatype, it would fail and ends up coming out with the ORA-1460 error.
Sam
How do I read the contents of a LONG column then ?