Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to put a Varchar into a Number?
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