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

Home -> Community -> Usenet -> c.d.o.misc -> Problem in manipulating a record

Problem in manipulating a record

From: Sandy80 <svarshneymail_at_gmail.com>
Date: 26 Mar 2007 02:12:37 -0700
Message-ID: <1174900357.635066.243210@y66g2000hsf.googlegroups.com>


Hi,

I have a requirement to manipulate a record as follows:

If the record is 22.85 I need to generate the value 0228500 from this record i.e. I need to take 3 values before the decimal point and 4 values after the decimal point replacing any missing value with a zero.
I am doing the manipulation as follows:

nvl(lpad(substr (rul.mid_value,0,INSTR(rul.mid_value, '.')-1 ),3,0) || rpad(substr (rul.mid_value,INSTR(rul.mid_value, '.')+1,4), 4,0),'0000000')||

Now the issue is that I have a record as 22 which does not have a decimal point and that is why the above manipulation is failing. The record cannot be changed and I somehow need to change my manipulation.

Any ideas??

Thanks,
Sandy Received on Mon Mar 26 2007 - 04:12:37 CDT

Original text of this message

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