Pl/PgSql: Loop over Array - Mailing list pgsql-general

From axel@pizza.home.kosnet.com (Axel Straschil)
Subject Pl/PgSql: Loop over Array
Date
Msg-id slrnbc9en7.711.axel@pizza.home.kosnet.com
Whole thread Raw
Responses Re: Pl/PgSql: Loop over Array
List pgsql-general
Ist it possible to loop over an array:

CREATE FUNCTION atest(INT[]) RETURNS TEXT AS '
    DECLARE
        myA ALIAS FOR $1;
        myI INT;
        myRet TEXT='''';
    BEGIN
        FOR myI IN myA LOOP
            myRet=myRet||''x''||myI;
        END LOOP;
        RETURN myRet;
    END;
' LANGUAGE 'plpgsql';

This Examle is not working ;-(

Thanks,
AXEL.

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: ERROR: Memory exhausted in AllocSetAlloc(188)
Next
From: Randeep Saini
Date:
Subject: postgresql help - steps are attatched this time