Quando realizamos a execução deste código abaixo,
SET SERVEROUTPUT ON;
DECLARE
v_ID VARCHAR(10) := 'Novo programa PL/SQL';
BEGIN
dbms_output.put_line(v_ID);
v_ID := 2 ;
dbms_output.put_line(v_ID);
END;
Ocorre o Erro do Oracle sendo ORA-06502: PL/SQL, conforme demonstrado abaixo,
Erro a partir da linha : 2 no comando -
DECLARE
v_ID VARCHAR(10) := 'Novo programa PL/SQL';
BEGIN
dbms_output.put_line(v_ID);
v_ID := 2 ;
dbms_output.put_line(v_ID);
END;
Relatório de erros -
ORA-06502: PL/SQL: erro: buffer de string de caracteres pequeno demais numérico ou de valor
ORA-06512: em line 2
06502. 00000 - "PL/SQL: numeric or value error%s"
*Cause: An arithmetic, numeric, string, conversion, or constraint error
occurred. For example, this error occurs if an attempt is made to
assign the value NULL to a variable declared NOT NULL, or if an
attempt is made to assign an integer larger than 99 to a variable
declared NUMBER(2).
*Action: Change the data, how it is manipulated, or how it is declared so
that values do not violate constraints.