> -----Original Message----- > From: Manley, Jim [mailto:[EMAIL PROTECTED]] > Sent: 03 April 2002 17:01 > To: '[EMAIL PROTECTED]' > Subject: Question about functions > > > Hi Dave,
Hi Jim, Please use the [EMAIL PROTECTED] list for future support issues. > I am having a problem developing advanced functions in > pgAdmin. I want to do something like this: > > CREATE FUNCTION get_city (varchar) RETURNS varchar > AS ' > > DECLARE > > vLastName ALIAS FOR $1; > vCity VARCHAR; > > BEGIN > SELECT city INTO vCity > FROM customer > WHERE last_name = vLastName; > > END; ' > > language 'sql'; ^^^ Your code is plpgsql so the parser doesn't understand it when you specify it as sql (kinda like writing C++ in Microsoft Visual Basic). Specify plpgsql as the language and you should be OK (note, this isn't installed by default with PostgreSQL, you may need to run the createlang script on your server). Regards, Dave. ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])