I have this procedure:
CREATE OR REPLACE PROCEDURE PROC_DESCUENTO (CLIENTE IN VARCHAR2)
IS V_PRODUCTO VARCHAR2(30);
V_CLIENTE VARCHAR2(45);
V_DESCUENTO NUMBER;
BEGIN
SELECT P.DESCRIPCION,
Z.NOMBRE ' 'Z.APELLIDOM ' 'Z.APELLIDOP AS NOMBRE,
(P.VUNITARIOD.CANTIDAD)0.2 AS DESCUENTO
INTO
V_PRODUCTO,
V_CLIENTE,
V_DESCUENTO
FROM DETALLE D JOIN PRODUCTO P
ON d.cod_detalle = p.codproducto
JOIN BOLETA B
ON(b.cod_boleta = d.cod_detalle)
JOIN CLIENTE C
ON(c.cod_cliente = b.cod_boleta)
JOIN PERSONA z
ON(c.rut = z.rut)
WHERE z.nombre = CLIENTE
ORDER BY d.cantidad desc;
DBMS_OUTPUT.PUT_LINE(V_PRODUCTOV_CLIENTEV_DESCUENTO);
END PROC_DESCUENTO ;
This compiles very well but when I'm going to execute this procedure using a string parameter (client's name called Barry in my BD)
SET SERVEROUTPUT ON;-- LLAMDO POR PARAMETROS PROCEDIMIENTO
EXECUTE PROC_DESCUENTO('Barry');
numeric or value error: character string buffer too small
I don't know why I get this since Barry has 4 digits only on his name.