Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: having a senior moment and can't fingure
Hi,
your query can be like this:
select field1 from table1 where length(field1) = 4 and is_number(field1) = 1;
while is_number is seperate function like this:
declare
n_num_temp number;
begin
n_num_temp := to_number(p_num);
n_result := 1;
exception
when others then
n_result := 0;
end;
return n_result;
end is_number;
/
regards,
tomi
> I am having a senior moment today .....
>
> sI want to get only those varchar2 fields back with
> a length of 4 that are
> numeric
>
> select field from table where length(field) = 4 and
>
> between '0001' and '9999' - I used this but I get
> alpha characters back.
>
> I know it is something simple but I am just going
> blank.
>
> Kathy
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Oct 27 2004 - 00:33:56 CDT
![]() |
![]() |