Search Postgresql Archives

Re: triggers problems whit function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El mié, 22-10-2008 a las 15:01 -0500, Ma. Cristina Peña C. escribió:
> I want to use a function in to a trigger 
> 
>  
> 
> This is my
> 
> CREATE FUNCTION "subradio"(integer) RETURNS integer AS 'select
> cast(count (claveubica) as integer ) from asradios where ubicacion
> =0;' LANGUAGE 'sql';
> 
>  
> 
> And my ttrigger is 
> 
> CREATE TRIGGER validaradios AFTER DELETE ON subestacion FOR EACH ROW
> EXECUTE PROCEDURE subradio(0);
> 
>  
> 
> But I got an error 
> 
> ERROR:  CreateTrigger: function subradio() does not exist
> 
>  
> 
> What can I do??

write your function in plpgsql

http://www.postgresql.org/docs/8.3/interactive/plpgsql-trigger.html




 

> 
>  
> 
>  
> 
> cid:image002.jpg@01C8F24F.E2D90230
> 
> Ing. María Cristina Peña C.
> 
> Analista Programador
> 
>  
> 
> Sensa Control Digital S.A. de C.V.
> 
> Dir. Av. Bravo #93 Ote.
> 
> Col. Centro.
> Torreón Coah.
> 
>  
> 
> Tel. Directo:  (871) 747 01 04
> 
> Conmutador: (871) 747 01 01 
> 
> Tel. Fax:        (871) 747 01 90 
> 
> Correo Electrónico: mpena@xxxxxxxxxxxxxx
> 
>  
> 
> 

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux