plpgsql Integer Concat To String

From: "Paul Punett" <paul(dot)punett(at)shazamteam(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: plpgsql Integer Concat To String
Date: 2003-12-18 14:56:35
Message-ID: LEEEJFIHCGEJHMKLKOFBOEALCAAA.paul.punett@shazamteam.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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

In response to

  • plpgsql at 2003-12-18 14:25:03 from Paul Punett

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-12-18 15:11:33 Re: SELECT FOR UPDATE differs inside and outside a pl/pgsql
Previous Message Tom Lane 2003-12-18 14:47:27 Re: BUG #1013: Authentication doesn't work

Browse pgsql-hackers by date

  From Date Subject
Next Message Shridhar Daithankar 2003-12-18 15:04:01 Re: Project status pages
Previous Message Robert Treat 2003-12-18 14:46:02 Re: Project status pages