Re: trigger compile problem

Поиск
Список
Период
Сортировка
От T.R.Missner@Level3.com
Тема Re: trigger compile problem
Дата
Msg-id EBFCF3982143D511A77F0008C716807E0106DB2D@N0400IDC1.oss.level3.com
обсуждение исходный текст
Ответ на trigger compile problem  (T.R.Missner@Level3.com)
Список pgsql-general
I wasn't sure about the quotes and have taken
them off ( didn't have them in the beginning )
but the problem still exists.
I was just looking at other trigger code and was
wondering if maybe I need a ; after the last END?

-----Original Message-----
From: Doug McNaught [mailto:doug@wireboard.com]
Sent: Tuesday, September 25, 2001 5:36 PM
To: Missner, T. R.
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] trigger compile problem


T.R.Missner@Level3.com writes:

> Can anyone out there help me.
> I have created a trigger and can't get it to run.
> When it is invoked I get a compile error no matter what.
> .I have changed the code in the trigger many times and it really doesn't
> matter what the code actually does it still won't compile.
> I have stripped it down so all it does is return NEW and still the
problem.

It's not clear where the problem is from your post, though you seem to
have made some mistakes, which I will point out below.  Want to post
your CREATE TRIGGER statement as well?

> here is the error
>
> ERROR: parse error at or near ""
>
> here is the code
>
> CREATE FUNCTION "AANEW" () RETURNS opaque AS '
> DECLARE myrec sipmsg_lu%ROWTYPE;
> BEGIN
>  SELECT INTO myrec * FROM sipmsg_lu WHERE callid=''NEW.callid'';

Why are you quoting NEW.callid?  As written above you are comparing
sipmsg_lu.callid to the literal string 'NEW.callid' which is almost
certainly not what you want.  Take the quotes off.

>  IF NOT FOUND THEN
>   INSERT INTO sipmsg_lu VALUES (NEW.time , ''NEW.callid'');

Same here.

Otherwise nothing looks obviously wrong.

Are you writing the trigger code on a Windows machine?  Is it possible
that there are ^M characters in the text?

-Doug
--
In a world of steel-eyed death, and men who are fighting to be warm,
Come in, she said, I'll give you shelter from the storm.    -Dylan

В списке pgsql-general по дате отправления:

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: trigger compile problem
Следующее
От: T.R.Missner@Level3.com
Дата:
Сообщение: Re: trigger compile problem