Re: [SQL] problem w/plpgsql proc

2001-10-15 Thread Aasmund Midttun Godal
I may be wrong, but I believe you should not have a semicolon after beginning a loop (in the for clause) and the IF NOT EXISTS clause should be different: you are probably wanting FOUND which is a special variable so you will have to do the select first and then check the FOUND variable afterw

Re: [SQL] problem w/plpgsql proc

2001-10-15 Thread Tom Lane
leo <[EMAIL PROTECTED]> writes: > CREATE FUNCTION editEmail(integer, smallint, varchar, varchar) RETURNS > integer AS ' > ... > -- if it wasn't, then insert the new record. An undoubled quote mark in a function body is bad news... regards, tom lan

Re: [SQL] problem w/plpgsql proc

2001-10-15 Thread Josh Berkus
Leo, You're gonna feel like a dork when I point it out ... > -- if the emailaddr was found, then update the record. > -- if it wasn't, then insert the new record. ^^^ SINGLE QUOTE HERE!! BAD! You can't have single quotes inside a function, especially in comments. They will be trea

[SQL] problem w/plpgsql proc

2001-10-15 Thread leo
Hi all - This might be the wrong forum for this, but I don't want to cross-post unless someone tells me I should. Anyways, I'm having a problem trying to compile this plpg proc. I'll post the proc and the errors. I'm coming from a T-SQL background, so hopefully when I get the hang of Pl/PgSQ