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

Home -> Community -> Usenet -> c.d.o.server -> Re: varchar2 and number

Re: varchar2 and number

From: Igor V. Podolsky <igoryok_at_soft-review.kiev.ua>
Date: 2000/08/09
Message-ID: <AAg_JavC50d@soft-review.kiev.ua>#1/1

"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

Original text of this message

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