From: | Fernandos Siguenza <fsigu(at)hotmail(dot)com> |
---|---|
To: | <jchavezb(at)gmail(dot)com> |
Cc: | Foro Postgres <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | RE: Funcion Found no funciona |
Date: | 2009-08-14 16:50:52 |
Message-ID: | SNT108-W12558DC2520A2A557487DCA1020@phx.gbl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Gracias migo por responder pero a que te refieres con el coallesce,
Porque intente preguntar por
if vSaldoAnterior=null
vsaldoAnterior=0
end if
pero tampoco funciono
Saludos
Date: Fri, 14 Aug 2009 16:39:43 +0100
Subject: Re: [pgsql-es-ayuda] Funcion Found no funciona
From: jchavezb(at)gmail(dot)com
To: fsigu(at)hotmail(dot)com
CC: pgsql-es-ayuda(at)postgresql(dot)org
2009/8/14 Fernandos Siguenza <fsigu(at)hotmail(dot)com>
Amigos como estan necesito su ayuda tengo un select el cual necesito
saber si encontro algun valor o no para lo cual uso el found pero no se
que estoy haciendo mal que no me funciona a si que espero me puedan
ayudar
esta es la parte del codigo donde no me funciona
if vcuenta!=rCuenta.asicuecod and vTodos=0 then
select into vSaldoAnterior sum(asideb)-sum(asihab)
FROM asicab,asidet
WHERE asicab.asiagecod=asidet.asiagecod and asicab.asidoc=asidet.asidoc
and asicab.asinum=asidet.asinum
and asicab.asiagecod=AgeCod
and asidet.asicuecod=rcuenta.asicuecod
and asifec<vFechaInicio;
if NOT FOUND then
vSaldoAnterior:=0;
end if;
raise notice 'no encontro%',vSaldoAnterior;
end if;
Si no encuentra nada la variable VSaldoAnterior tiene el valor de null y no cero como deseo.
Espero me puedan dar una mano a ver que estoy haciendo mal
Saludos
no se como funciona el FOUND pero podrias hacer un coallesce cuando sea nulll mandas un 0 ...
slds.
JC
--
Cumprimentos
jchavez
linux User #397972 on http://counter.li.org/
Charles de Gaulle - "The better I get to know men, the more I find myself loving dogs."
_________________________________________________________________
From | Date | Subject | |
---|---|---|---|
Next Message | Javier Chávez B. | 2009-08-14 16:51:38 | Re: Funcion Found no funciona |
Previous Message | Ing. Eris J. Gómez | 2009-08-14 16:50:20 | Funcion no funciona |