Re: Funcion Found no funciona

From: Javier Chávez B(dot) <jchavezb(at)gmail(dot)com>
To: Fernandos Siguenza <fsigu(at)hotmail(dot)com>
Cc: Foro Postgres <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Funcion Found no funciona
Date: 2009-08-14 15:39:43
Message-ID: ded64bba0908140839n475d4fdft58aac6ee83dfb6ed@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

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<http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html>
- "The better I get to know men, the more I find myself loving dogs."

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Mariano Reingart 2009-08-14 15:42:18 Abierta la inscripción a PyCon Argentina 2009
Previous Message Javier Chávez B. 2009-08-14 15:37:52 Re: EXAMPLE USANDO DBLINK (POR JAVIER LUGO PORRAS)