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

Home -> Community -> Usenet -> c.d.o.tools -> Re: is number

Re: is number

From: <eastking_at_my-deja.com>
Date: Fri, 15 Sep 2000 02:43:04 GMT
Message-ID: <8ps2bk$f1g$1@nnrp1.deja.com>

In article <8pq049$dn8$1_at_goliat.eik.bme.hu>,   Horvath Andras <raas_at_balu.sch.bme.hu> wrote:
> eastking_at_my-deja.com wrote:
> > I'd like to insert a row whose id is max(to_number(id))+1 into this
> > table . In this case , the id should be 3. But to_number('ab') will
> > cause a error.How can I achieve it by only a SQL command.
>
> select max(to_number(id)) from table where id>'0' and id<'99';
>
> will work well, provided that the field id is 2 characters long at
 max.
>
> raas
> --
> "With enough free time, effort, and an input string that looks like
 the
> winning entry in last year's obfuscated-C contest, you can turn
> someone's simple mistake into a nationally syndicated news story."
>

I'm afraid it can not work well. Try following

select 'yes' from dual where '1a' > '0' and '1a' < '99'

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Sep 14 2000 - 21:43:04 CDT

Original text of this message

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