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

Home -> Community -> Usenet -> c.d.o.tools -> Re: converting car in num

Re: converting car in num

From: Daniel A. Morgan <Daniel.Morgan_at_attws.com>
Date: Thu, 21 Jun 2001 14:27:00 -0700
Message-ID: <3B3266A4.FCE13772@attws.com>

Philippe Makowski wrote:

> haw can I convert a field (varchar5) in num ?
> my field contain num and char for example I have the value 456 B or 456/ in
> my field and I want to convert it in 456

If your examples are as simple as show there is one solution. But if you have examples like this "123 456 /" or "123 / 2" the solution is different. How representative are your examples? And are there no periods that need to be interpreted as decimals?

In the end you will need to create a loop with a nested FOR loop. Then step through each record, and within each record step through each character, matching for a numerical value, concatenating them as strings, and finally casting them as a number.

Daniel A. Morgan Received on Thu Jun 21 2001 - 16:27:00 CDT

Original text of this message

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