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





---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to