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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Diagnostic Query to avoid ORA-01722 Error

Re: Diagnostic Query to avoid ORA-01722 Error

From: TurkBear <john.greco_at_dot.state.mn.us>
Date: Thu, 26 Sep 2002 12:50:44 -0500
Message-ID: <l3i6pu49j3ir1jbl6rkka0sj3r98j6itt8@4ax.com>

Why an error - Max uses an implicit conversion to ASCII for the entire string in the Varchar2 field and computes the Max SQL> select max(empl_nm) from hr_public;

MAX(EMPL_NM)



Zwart,Benjamin Jacob

SQL> If you are, however, using the To_Number function first, then you will get that error..

tsu_at_landacorp.com (Tom Urbanowicz) wrote:

>I have a utility that selects the maximum value from a VARCHAR2
>column. Obviously, if there is a non-numeric value in the column I
>encounter the expected an ORA-01722 error.
>
>Is there a "select count(*)" query I can use to first identify if
>non-numeric values exist in the column? I could then issue this
>diagnostic query before issuing my query for the maximum value? If the
>column has non-numeric values in it, I can skip selecting the maximum
>value from the column.
>
>Wth thanks

-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------

   http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =----- Received on Thu Sep 26 2002 - 12:50:44 CDT

Original text of this message

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