plpgsql

From: "Paul Punett" <paul(dot)punett(at)shazamteam(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: plpgsql
Date: 2003-12-18 14:25:03
Message-ID: LEEEJFIHCGEJHMKLKOFBMEAKCAAA.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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Puneet Paul 2003-12-18 14:29:30 plpgsql Integer Concat To String
Previous Message PostgreSQL Bugs List 2003-12-18 13:07:15 BUG #1014: postgres crash

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2003-12-18 14:46:02 Re: Project status pages
Previous Message ohp 2003-12-18 14:07:16 Re: TODO list