In Oracle I this function:
CREATE OR REPLACE function is_number
( p_string in varchar2 )
return number
deterministic
as
l_num number;
begin
l_num := p_string;
return 1;
exception
when others then
return null;
end;
/
On 2/9/06, Jim Wright <[EMAIL PROTECTED]> wrote:
>
> In MS-SQL, there is a isNumeric function...it may get you most of the
> way there, but also I will tell you that sometimes it returns true for
> things that won't convert...case in point...throw this in query
> analyzer....
>
> select isnumeric('1,1.1') 'returns true
> select cast('1,1.1' as numeric) 'throws error
>
> On 2/9/06, Robert Everland III <[EMAIL PROTECTED]> wrote:
> > Is there a way in MSSQL and Oracle or either that will allow you to do a
> select on a varchar field and be able to see if that record can be converted
> to a number? We have a ton of databases that used varchar to handle numbers
> and are getting issues now that some records have gotten data other than a
> number in them. I want to convert them to an integer field but can't do that
> until we fix the problem records.
> >
> >
> >
> > Bob
> >
> >
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:231834
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54