From: | T(dot)R(dot)Missner(at)Level3(dot)com |
---|---|
To: | doug(at)wireboard(dot)com |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: trigger compile problem |
Date: | 2001-09-25 23:44:23 |
Message-ID: | EBFCF3982143D511A77F0008C716807E0106DB2F@N0400IDC1.oss.level3.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
It was the ; after END
I feel like a tard.
spent over 5 hours on this .
thanks
t.r.
-----Original Message-----
From: Doug McNaught [mailto:doug(at)wireboard(dot)com]
Sent: Tuesday, September 25, 2001 5:36 PM
To: Missner, T. R.
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] trigger compile problem
T(dot)R(dot)Missner(at)Level3(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Lamar Owen | 2001-09-26 00:32:34 | Re: postgresql.conf |
Previous Message | T.R.Missner | 2001-09-25 23:41:26 | Re: trigger compile problem |