vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello friends, excuse me if my question is too simple , but I am relatively new to Sybase. Is there any function in Sybase SQL to check whether a value or a string is numeric or not or Do I need to get each char in the string and use ascii function? I checked the Sybase ASE Transact SQL User's guide , but could not find it. (may be I didn't look good enough I intend to use it within a Stored Procedure , version of Sybase is 12.5 Thanks |
| ||||
| On Wed, 15 Feb 2006 14:07:45 +0100, debdutta.mohanty@gmail.com <debdutta.mohanty@gmail.com> wrote: > excuse me if my question is too simple , but I am relatively new to > Sybase. > > Is there any function in Sybase SQL to check whether a value or a > string is numeric or not or Do I need to get each char in the string > and use ascii function? I checked the Sybase ASE Transact SQL User's > guide , but could not find it. (may be I didn't look good enough > > I intend to use it within a Stored Procedure , version of Sybase is > 12.5 There's no built-in function for this, but you can work around that with 'like'. Something like this should do the trick: varchar_col not like '%[^0-9]%' Works for integers at least, if you need to validate floating point strings, things get a bit more complicated. Jochen |