plpgsql Integer Concat To String - Mailing list pgsql-hackers

From Paul Punett
Subject plpgsql Integer Concat To String
Date
Msg-id LEEEJFIHCGEJHMKLKOFBOEALCAAA.paul.punett@shazamteam.com
Whole thread Raw
Responses Re: plpgsql Integer Concat To String
List pgsql-hackers
Hi,

I want to concatenate a it counter to a string in a loop in plpgsql.
DECLARE
counter integer := 1;
IdSet char : = 'UniqueId'
IdForEachRun varchar;
BEGIN

IdForEachRun := IdSet || counter;(PROBLEM HERE)
--Or IdForEachRun := IdSet + counter;(PROBLEM HERE)
While condition LOOP

Insert into Table values(IdForEachRun, ......)



counter := counter + 1;
IdForEachRun := IdSet || counter;(PROBLEM HERE)
--Or IdForEachRun := IdSet + counter;(PROBLEM HERE)
END LOOP

END
Language 'plpgsql'

Thanks in advance.

Paul Puneet


pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: Project status pages
Next
From: Shridhar Daithankar
Date:
Subject: Re: Project status pages