Home » SQL & PL/SQL » SQL & PL/SQL » ORA-06502: PL/SQL character string buffer too small (10g)
ORA-06502: PL/SQL character string buffer too small [message #406817] Sat, 06 June 2009 02:02 Go to next message
McLan
Messages: 36
Registered: April 2008
Member
I had looked at earlier posts on same error, but the issue in the earlier posts is variable length is shorter than the string.
I have defined variable to store length of 300 varchar2. but unable to store the string of length 254.

I get the ORA-06502: error when I get substring form original string to temp_str.

See the attachment for the code and output from sql

My intention is to print the text in string to the maximum of 256 chars in a line and should not break the text in between, I should only break the text where ever there is a comma(,).

Please help me.

Regards,
  • Attachment: sam.sql
    (Size: 3.12KB, Downloaded 145 times)
Re: ORA-06502: PL/SQL character string buffer too small [message #406821 is a reply to message #406817] Sat, 06 June 2009 02:57 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Which one is line 20?
What is your setting for your serveroutput buffer size?

Regards
Michel
Re: ORA-06502: PL/SQL character string buffer too small [message #406823 is a reply to message #406817] Sat, 06 June 2009 02:59 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
comment following statement in your code and you will get problem.

select substr(orig_str,start_pos,end_pos) into tempstr from dual;


regards,
Delna
Re: ORA-06502: PL/SQL character string buffer too small [message #406845 is a reply to message #406817] Sat, 06 June 2009 06:12 Go to previous messageGo to next message
cookiemonster
Messages: 12409
Registered: September 2008
Location: Rainy Manchester
Senior Member
I think you need to look up what substr actually does.
The third parameter is not end position.
Re: ORA-06502: PL/SQL character string buffer too small [message #406951 is a reply to message #406817] Mon, 08 June 2009 00:03 Go to previous message
McLan
Messages: 36
Registered: April 2008
Member
Yes, I misinterpreted / misunderstood the third parameter.
I defined the tmpstr for 300 char length, but wanted to store the string length of 505.
Thanks a lot.
Previous Topic: Conditional MIN Function
Next Topic: Error in Fetching data thru SQLPLUS
Goto Forum:
  


Current Time: Tue Dec 06 11:52:51 CST 2016

Total time taken to generate the page: 0.22267 seconds