plpgsql Integer Concat To String

From: Puneet Paul <paulptech(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: plpgsql Integer Concat To String
Date: 2003-12-18 14:29:30
Message-ID: 20031218142930.29076.qmail@web14525.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-12-18 14:47:27 Re: BUG #1013: Authentication doesn't work
Previous Message Paul Punett 2003-12-18 14:25:03 plpgsql