Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Is there a replicate type of function in Oracle?

Is there a replicate type of function in Oracle?

From: Harvinder Singh <Harvinder.Singh_at_MetraTech.com>
Date: Fri, 2 Feb 2007 16:54:58 -0500
Message-ID: <D6424CD4C8A3C044BBC49877ED51C51804E02789@ex2003.metratech.com>


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

--

http://www.freelists.org/webpage/oracle-l Received on Fri Feb 02 2007 - 15:54:58 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US