Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group