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 -> Re: How to put a Varchar into a Number?

Re: How to put a Varchar into a Number?

From: Pierre Charpenay <pcharpenay_at_unilog.fr>
Date: Wed, 09 Feb 2000 13:48:49 +0100
Message-ID: <38A16230.768CAEC7@unilog.fr>

Ken Sproule wrote :

>
> DECLARE
> MyNum NUMBER(20,2);
> MyVar VARCHAR2(20);
> CURSOR test_cur is select * from XXXX;
> test_val test_cur%ROWTYPE;
>
> BEGIN
> Open test_cur;
> Fetch test_cur into test_val;
> -- test_val.cost is a a VARCHAR2 with this in it =è '006.100'
> MyVar := test_val.cost ;
> REPLACE( MyVar . '.' );

What is this ? (equivalent for MyVar=replace(MyVar, '.') (remove the point) ? Are you sure of the result ?

>
> MyNum := MyVar; -- *********** Blows here

If MyVar is correct, the to_number() function must work.

>
> END;
Bye.

--
 Pierre CHARPENAY Received on Wed Feb 09 2000 - 06:48:49 CST

Original text of this message

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