RE: Ayuda con funcion

From: José Fermín Francisco Ferreras <josefermin54(at)hotmail(dot)com>
To: <grover8navia(at)yahoo(dot)es>, Lista PostgreSQL <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: RE: Ayuda con funcion
Date: 2010-03-04 01:45:09
Message-ID: COL103-W294FDEAD2F1F79C4B91AE1C6390@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

ing. José Fermín Francisco Ferreras
San Francisco de Macorís, Rep. Dom.

Date: Thu, 4 Mar 2010 00:03:38 +0000
From: grover8navia(at)yahoo(dot)es
Subject: [pgsql-es-ayuda] Ayuda con funcion
To: pgsql-es-ayuda(at)postgresql(dot)org

Hola Listeros

Tengo un problema con uan funcion que realice, me sale el siguiente error al ejecutar:

Error while executing the query;
ERROR: row "kardex_item_tabla" has no field "c_ingreso"

Por favor si alguien puede ayudarme con esto, es probable que no este manejando bien las consultas. Esta es la funcion :


DECLARE
kardex_item_tabla almacenes.alm_kardex%ROWTYPE;
BEGIN
SELECT SUM(cant_entrada) AS c_ingreso, SUM(cant_salida) AS c_salida, SUM(importe_entrada) AS i_ingreso, SUM(importe_salida) AS i_salida INTO kardex_item_tabla
FROM almacenes.alm_kardex
WHERE gestion = New.gestion AND mes = New.mes AND cod_prod = New.cod_prod
GROUP BY gestion, mes, cod_prod;
IF FOUND THEN
New.sum_cant_entrada = kardex_item_tabla.c_ingreso;
New.sum_cant_salida = kardex_item_tabla.c_salida;
New.sum_importe_entrada = kardex_item_tabla.i_ingreso;
New.sum_importe_salida = kardex_item_tabla.i_salida;
END IF;
RETURN NEW;
END;



De antemano les doy las gracias por su ayuda.

Saludos
Grover Navia

Estas Seguro q tienes el campo llamado c_ingreso en tu tabla??

_________________________________________________________________

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Ing . Marcos Luís Ortíz Valmaseda 2010-03-04 03:48:19 Re: Ayuda con funcion
Previous Message Cesar Erices 2010-03-04 01:34:51 consulta resta fechas