Re: how to test if strings are numeric ?

2005-12-03 Thread SGreen
Anoop kumar V <[EMAIL PROTECTED]> wrote on 12/03/2005 11:59:10 AM: > This is very useful. > > Can you please also show how this can be used to validate user input like > for example: > > We have this query currently: > > select id from users where id like '%'; > > Now I want to validate that

Re: how to test if strings are numeric ?

2005-12-03 Thread Michael Stassen
"C.R.Vegelin" <[EMAIL PROTECTED]> wrote: > > Hi everybody, > I looked for a function to test whether a string is numeric (having > characters 0..9 only). I found in the 5.0 manual Cast() and Convert(), but > I don't think these do what I need. Any suggestion what function to use ? > Thanks in adva

Re: how to test if strings are numeric ?

2005-12-03 Thread Anoop kumar V
This is very useful. Can you please also show how this can be used to validate user input like for example: We have this query currently: select id from users where id like '%'; Now I want to validate that the user-enterred-value is only a numeric value... (the major problem is where users ente

Re: how to test if strings are numeric ?

2005-12-03 Thread Gleb Paharenko
Hello. Possible solution is to use REGEXP: mysql> select '911' regexp '^[1-9]*$'; +-+ | '911' regexp '^[1-9]*$' | +-+ | 1 | +-+ mysql> select

how to test if strings are numeric ?

2005-12-03 Thread C.R.Vegelin
Hi everybody, I looked for a function to test whether a string is numeric (having characters 0..9 only). I found in the 5.0 manual Cast() and Convert(), but I don't think these do what I need. Any suggestion what function to use ? Thanks in advance, Cor