problemas con out de PL/SQL

josseph_o
02 de Enero del 2010
Hola a la comunidad Oracle, agradesco de antemano la ayuda otorgada, esta en mi duda:
Tengo el siguiente procedimiento creado con parametros de entrada y salida:
create or replace procedure inserta_departamento
(
p_codigo in dept.deptno%type,
p_nombre in dept.dname%type,
p_lugar in dept.loc%type,
p_mensaje out varchar2
)
is
begin
insert into dept values(p_codigo,p_nombre,p_lugar);
p_mensaje:='隆Inserci贸n realizada!';
--dbms_output.put_line('隆Inserci贸n realizada!');

exception
when others then
dbms_output.put_line('Error Nro. ORA'||sqlcode);
dbms_output.put_line(sqlerrm);
p_mensaje:='Error... El registro no se pudo insertar.';
--dbms_output.put_line('Error... El registro no se pudo insertar.');

end inserta_departamento;
/

Procedure created.

Cuando intento ejecutarlo no logro hacerlo, estos son los mensajes de errores que me muestra oracle:

SQL> execute inserta_departamento(60,'w','tt');
BEGIN inserta_departamento(60,'w','tt'); END;

*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'INSERTA_DEPARTAMENTO'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

SQL> variable a varchar2(20);
SQL> execute inserta_departamento(60,'w','tt',:a);
Error Nro. ORA-6502
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
BEGIN inserta_departamento(60,'w','tt',:a); END;

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SCOTT.INSERTA_DEPARTAMENTO", line 18
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 1

Espero que me ayuden, gracias.