From: | "Mario Alberto Soto Cordones" <mario_soto(at)venezolanadeavaluos(dot)com> |
---|---|
To: | <marcosrios(at)planet(dot)com(dot)pe> |
Cc: | <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: Problema con una funcion |
Date: | 2004-05-23 19:11:47 |
Message-ID: | 43557.200.35.66.77.1085339507.squirrel@mail.venezolanadeavaluos.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Yo llamo a las funciones del siguiente modo y funciona:
select * from crea_vista_kdx(1, 1, 1001001)
P.D. Si no tiene que retornar nada sólo hacer un proceso entonces porque
no le dices que te retorne void:
Suerte
> 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.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: No hagas 'kill -9' a postmaster
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2004-05-23 19:34:41 | Re: Problema con una funcion |
Previous Message | Alvaro Herrera | 2004-05-23 16:58:02 | Re: Recuperar datos |