Re: [GENERAL] triggers problems whit function

2008-10-23 Thread MOLINA BRAVO FELIPE DE JESUS
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'; >

Re: [GENERAL] triggers problems whit function

2008-10-22 Thread Guillaume Lelarge
Tom Lane a écrit : > Guillaume Lelarge <[EMAIL PROTECTED]> writes: >> Fernando Moreno a écrit : >>> A trigger function must have a specific structure, it takes no arguments > >> It can take arguments. > > No, it can't. At least not in the declaration. > Oops, you're right. Arguments shouldn't

Re: [GENERAL] triggers problems whit function

2008-10-22 Thread Tom Lane
Guillaume Lelarge <[EMAIL PROTECTED]> writes: > Fernando Moreno a écrit : >> A trigger function must have a specific structure, it takes no arguments > It can take arguments. No, it can't. At least not in the declaration. regards, tom lane -- Sent via pgsql-general mai

Re: [GENERAL] triggers problems whit function

2008-10-22 Thread Guillaume Lelarge
Fernando Moreno a écrit : > 2008/10/22 Ma. Cristina Peña C. <[EMAIL PROTECTED] > > > > 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

Re: [GENERAL] triggers problems whit function

2008-10-22 Thread Fernando Moreno
2008/10/22 Ma. Cristina Peña C. <[EMAIL PROTECTED]> > 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

[GENERAL] triggers problems whit function

2008-10-22 Thread Ma . Cristina Peña C .
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