Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: varchar2 and number
"Sandy" <daleelaNOdaSPAM_at_usa.net.invalid> wrote in message
news:00024c9a.e3653153_at_usw-ex0109-068.remarq.com...
> hi,
>
> I have a form with two fields one for a number and for the
> decimal. I tried the character '||'to put them together in
> the same variable then it would be a number(15,2) but of
> course it doesn't work because i do like this :
>
> Price number(15,2);
> Dollar varchar2(15);
> cents varchar2(2);
>
> Price=Dollar ||','||cents;
You'd use something about
Price := to_number(Dollar ||','||cents);
or even better
Price := to_number(Dollar) + to_number(cents)/100;
to keep Your code working with different separators.
-- Is There A God Or Any Kind Of Justice Under The Sky... (Queen'91) Igor V. Podolsky (igoryok_at_i.am)Received on Wed Aug 09 2000 - 00:00:00 CDT
![]() |
![]() |