RE: Is there a replicate type of function in Oracle?

  • To: "Harvinder Singh" <Harvinder.Singh@xxxxxxxxxxxxx>, "oracle-l" <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 2 Feb 2007 17:08:04 -0500

I got it, Thanks a lot.

-----Original Message-----
From: Harvinder Singh 
Sent: Friday, February 02, 2007 4:55 PM
To: oracle-l
Subject: Is there a replicate type of function in Oracle?

Hi,

We need to write a query like the following that depending upon the
length of value in column we  have to replcate 0 that many times, so in
this example for a particular row if the length of column identifier is
2 we have to replcate '0' 6 times:
Select msisdnroot || replicate('0', 8 - length(cast(d.identifier as
varchar2(8)))) from tab d

Replicate is function in SQL Server, is there any equivalent in Oracle?

Thanks
--Harvinder


--
//www.freelists.org/webpage/oracle-l


Other related posts: