Re: Question about functions
От | Dave Page |
---|---|
Тема | Re: Question about functions |
Дата | |
Msg-id | FED2B709E3270E4B903EB0175A49BCB1293342@dogbert.vale-housing.co.uk обсуждение исходный текст |
Список | pgadmin-support |
> -----Original Message----- > From: Manley, Jim [mailto:JMANLEY@Trnsworld.com] > Sent: 03 April 2002 17:01 > To: 'dpage@pgadmin.org' > Subject: Question about functions > > > Hi Dave, Hi Jim, Please use the pgadmin-support@postgresql.org 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.
В списке pgadmin-support по дате отправления: