Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5GD1Na08378 for ; Sat, 16 Jun 2001 09:01:23 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f5GCo8L34836 for pgsql-sql@postgresql.org; Sat, 16 Jun 2001 08:50:08 -0400 (EDT) (envelope-from news) From: "Postgresql" X-Newsgroups: comp.databases.postgresql.sql Subject: calling user defined function with parameters.. Date: Sat, 16 Jun 2001 14:56:17 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 47 Message-ID: <9gfklv$120h$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/227 X-Sequence-Number: 3485 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