Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5KH92a05102 for ; Wed, 20 Jun 2001 13:09:02 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5F81Da29192 for ; Fri, 15 Jun 2001 04:01:13 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f5F7aLt09033 for pgsql-sql@postgresql.org; Fri, 15 Jun 2001 03:36:21 -0400 (EDT) (envelope-from news) From: "Postgresql" X-Newsgroups: comp.databases.postgresql.sql Subject: calling user defined functions with parameters.. ? Date: Fri, 15 Jun 2001 09:41:42 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 45 Message-ID: <9gcdtc$8q5$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: pgsql-sql@postgresql.org X-Archive-Number: 200106/310 X-Sequence-Number: 3578 Hi, I've created a function like this : CREATE FUNCTION tester(INT4) RETURNS BOOL AS ' DECLARE r RECORD; p ALIAS FOR $1; BEGIN SELECT INTO r id_dpt FROM dpts WHERE id_dpt=p; IF NOT FOUND THEN RETURN FALSE; ELSE RETURN TRUE; END IF; END; ' LANGUAGE 'plpgsql'; All is ok at creation. But now , how can i use my function ? i would like a thing like : SELECT tester(14) AS ok; But is make a Postgresql parser error How to do then ?? Thanks for any help or links (other than the postgresql.org website...) ! ;) Regards, Fred