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: Oracle/SQL - Help

Re: Oracle/SQL - Help

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Tue, 18 May 2004 22:26:59 -0700
Message-ID: <1084944422.725584@yasure>


Jay wrote:

> Hi Bricken,
> 
> Thanks for the tip. I am getting invalid number when I use to_number function...
> Is the comma as delimiter causing it?
> 
> Thanks again
> 
> Jay
>  
> Bricklen <bricklen-rem_at_yahoo.comz> wrote in message news:<cQrqc.19951$j6.19721_at_edtnps84>...
> 

>>Jay wrote:
>>
>>
>>>All,
>>>
>>>I have two fieds defined in a table as follows
>>>
>>>prev_val varchar2(200);
>>>curr_val varchar2(200);
>>>
>>>I have following data in that table.
>>>
>>>prev_val curr_val
>>>19,2 64
>>>64 2000
>>>9,6 19,2 <<<--- Need to retrieve this row
>>>0 9,6
>>>
>>>( comma is the decimal point here )
>>>
>>>I need to run a query with where clause like this:
>>>
>>>and prev_val <= '10'
>>>and curr_val > '10';
>>>
>>>or
>>>
>>>and prev_val <= 10
>>>and curr_val > 10;
>>>
>>>Obiviously the current scenerio won't work? How can I achieve this
>>>without altering the table?
>>>
>>>TIA
>>>
>>>J
>>
>>Apply a TO_NUMBER function to it:
>>select * from <table> where to_number(prev_val) <= '10' and
>>to_number(curr_val) > 10;
>>
>>(if I've understood correctly what you are asking for)

Possibly. Try using TRANSLATE to replace the commas with periods. What NLS parameters are set?

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Wed May 19 2004 - 00:26:59 CDT

Original text of this message

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