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

Thu, 18 Dec 2003 14:25:03 -0000
"Paul Punett" <paul.punett@shazamteam.com>
plpgsql
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

Thu, 18 Dec 2003 14:56:35 -0000
"Paul Punett" <paul.punett@shazamteam.com>
plpgsql Integer Concat To String
"Paul Punett" <paul.punett@shazamteam.com> writes:

> 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)

IdForEachRun := IdSet || counter::text;

-Doug

Thu, 18 Dec 2003 10:32:04 -0500
Doug McNaught <doug@mcnaught.org>
Re: plpgsql Integer Concat To String