is this possible in plpgsql ?

From: Marcin Winkler <qurczak(at)wolomin(dot)biz>
To: pgsql-sql(at)postgresql(dot)org
Subject: is this possible in plpgsql ?
Date: 2003-06-19 00:38:32
Message-ID: 20030619023832.2fe7ac5b.qurczak@wolomin.biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


I have 1 function in pg 7.3.2.

txt string have 1,2,3,.. and i would like to be similar like if 3 in
(1,2,3..) then, but IF 3 in (''''||txt||'''') THEN doesn't work.
There is possible to this or not ?

CREATE OR REPLACE FUNCTION rek2(INT8) RETURNS text AS '
DECLARE
i INT8;
BEGIN
txt := '''';
for i in 1 .. 10 loop
txt := txt||i||'','';
END loop;
txt := txt||''0'';
IF 3 in (''''||txt||'''') THEN
raise notice ''yep'';
END IF;
RETURN txt;
END;
' LANGUAGE 'plpgsql';

--
"Nieobecni nie mają racji"

Marcin Winkler

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Anagha Joshi 2003-06-19 11:41:12 Re: Latest transcation
Previous Message Jeff Eckermann 2003-06-18 19:13:49 Re: set decimal point in SQL