Error when inserting a Postgresql record

0

I have my created function which receives parameters and I want to insert them in my product table but I get an error

CREATE OR REPLACE FUNCTION insertarProducto(_codigo character,_descripcion CHARACTER VARYING,_precio MONEY,_stock INTEGER,_fecha DATE)
RETURNS VOID
AS
$BODY$
    BEGIN               
        INSERT INTO productos VALUES (_codigo,_descripcion,_precio,_stock,_fecha);
    END;
$BODY$
LANGUAGE PLPGSQL;
select insertarProducto('P0021','mueble',1500,50,now());
  

ERROR: the insert product function does not exist (unknown, unknown,   integer, integer, timestamp with time zone)
  LINE 2: select insertProduct ('P0021', 'furniture', 1500,50, now ());
  ^ HINT: No function matches the name and types of arguments.
  It may be necessary to add explicit type conversion.
  SQL state: 42883
  Character: 9

    
asked by Carlos Jordan Hernandez Alvara 29.05.2018 в 21:44
source

0 answers