[postgis-users] function in plpgsql

alex bodnaru alexbodn at 012.net.il
Fri Feb 20 15:10:48 PST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



eehab hamzeh wrote:
> Thanks for your replay
> i need to check if the resultof this query is null or not null then do
> two different things
>  as below
> if  SELECT DISTINCT o FROM ramadan  WHERE o=mypoint or a=mypoint
> UNION SELECT DISTINCT a FROM ramadan WHERE o=mypoint or a=mypoint;
>  
> is null then
> 
look at if exists, though pay attention if it works properly with union.
also you may select into a variable, and check whether it's empty.
>  
>  
> INSERT INTO eehab (field1) -- replace with whatever your field name is
> SELECT DISTINCT o
> FROM ramadan
> WHERE o=mypoint or
> a=mypoint
> UNION SELECT DISTINCT a
> FROM ramadan
> WHERE o=mypoint or a=mypoint;
> 
>  
> else
> do some thing else
>  
>  
> can u please give me diretion to do so. i have limmited time to develop
> this function
>  
> kind regards
>  
> 
> ------------------------------------------------------------------------
> check out the rest of the Windows Live™. More than mail–Windows Live™
> goes way beyond your inbox. More than messages
> <http://www.microsoft.com/windows/windowslive/>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

- --
- --
best regards,
alex
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iJwEAQECAAYFAkmfOHgACgkQ2nA3WyrfyePeygQAul1jdgA+IvhxrTdRk1hU437m
ik6xBdcED0DHKkStrKGFF5N6Hz8/CmUjsSH/H5tev4e//xgezX35WdaBtdPGn6ZF
tLSk85BwhovspCZm6VljkEcUAYoSXDW4TcSgRV2gcz0qF9/FexOD3dejHlXpWMlF
j49YCs3PToq6zOxjoiI=
=iFa9
-----END PGP SIGNATURE-----



More information about the postgis-users mailing list