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!

RAISE_APPLICATION_ERROR Gets ORA-06502 When Message is 198 Chars or More

758325May 12 2010 — edited May 14 2010
Hi,

I'm seeing a problem in our 10.2.0.4 database where RAISE_APPLICATION_ERROR gets an ORA-06502: PL/SQL: numeric or value error: character string buffer too small error when a value of 198 characters or more is passed in the msg parameter. The anonymous block below is an example of when the error occurs.


DECLARE

lv_error_msg VARCHAR2(4000) := NULL;

BEGIN
-- 198 char DOES NOT work.
lv_error_msg := LPAD('$',198,'$');

IF (lv_error_msg IS NOT NULL) THEN
RAISE_APPLICATION_ERROR(-20100,lv_error_msg);
END IF;

END;

This is just a simple demo to show what's more or less happening in an application and not exact code used in the application. Does anyone know why this throw the ORA-06502 when I pass 198 characters or more? I should be able to pass a lot more than that.

Thanks for any insight!

Mike
This post has been answered by Solomon Yakobson on May 14 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2010
Added on May 12 2010
26 comments
3,636 views