String to number conversion 2007-06-20 - By Dusan Kolesar
Back Hello, thank you very much. It is working correctly. Nice solution.
Dusan
On Tue, 19 Jun 2007 20:03:06 +0200, Lukasz Misztal <miszluk@(protected)> wrote:
> Dusan, > try to create own function, for basic example: > > CREATE FUNCTION GETASNUMERIC (s1 VARCHAR) RETURNS NUMERIC > AS > IF UPPER(s1) = LOWER(s1) > THEN RETURN NUM(s1) > ELSE RETURN null; > > It is probably only way to do this. > > Best regards, > > Lukasz > >> Hello, >> I want to convert Varchar ASCII column to Integer data type. >> When I'm using NUM () function and my string column contains >> characters that cannot be interpreted as a numeric value >> statement returns me an error. >> Is it possible to convert chracters to numbers, while entries that >> cannot be interpreted as a numeric values will be null ?? >> >> Thanks Dusan >
-- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/maxdb?unsub=mysql@(protected)
|
|