Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Diagnostic Query to avoid ORA-01722 Error
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)
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