Problema con una funcion

From: marcosrios(at)planet(dot)com(dot)pe
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Problema con una funcion
Date: 2004-05-22 18:03:35
Message-ID: 1085249015.40af95f7256c4@www.planet.com.pe
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola amigos,

He creado la siguiente funcion:
CREATE OR REPLACE FUNCTION crea_vista_kdx(int2,int2,int4) RETURNS int2 AS '
DECLARE
v_empresa ALIAS FOR $1;
v_sucursal ALIAS FOR $2;
v_producto ALIAS FOR $3;
v_fechadesde := ''2002-07-01'';
v_fechahasta := ''2002-07-31'';
BEGIN
RAISE NOTICE ''Creando Vista del Kardex'';
CREATE OR REPLACE VIEW kardexval AS
SELECT *
FROM kardex_valorado
WHERE empresa=v_empresa
AND sucursal=v_sucursal
AND cod_producto=v_producto
ORDER BY empresa,sucursal,cod_producto,fecha,tipo,comprobante;
RAISE NOTICE ''Creacion de Kardex Finalizado..'';
RETURN 1;
END;
' LANGUAGE plpgsql;

El problema es que no se como llamar a esta funcion enviando parametros,
intente de la siguiente forma:

select crea_vista_kdx(1, 1, 1001001)

y me genera este error:

ERROR: Function crea_vista_kdx(integer, integer, integer) does not exist
Unable to identify a function that satisfies the given argument types
You may need to add explicit typecasts

Hice la prueba sin parametros y funciona bien.

Por favor, como debo llamar a la funcion enviando parametros y que funcione.

Gracias.

Marcos.

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Efren Garcia 2004-05-23 06:36:42 Re: Problema con una funcion
Previous Message Henry Orlando Interiano 2004-05-22 14:19:19 Re: Re: