RAISE_APPLICATION_ERROR Gets ORA-06502 When Message is 198 Chars or More
758325May 12 2010 — edited May 14 2010Hi,
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