1 Reply Latest reply on Jul 7, 2014 11:30 AM by Steven Hawkins

    SQL function 'isnumeric' not working in Teiid

    Madhurika Sharma Newbie

      I am trying to use the below query to check if the field is numeric . Based on which i am doing orderby in SQL query.

      select * from [dbo].[tablename]

      ORDER BY col1,

              ISNUMERIC(replace(col2,'T','')),

              CASE WHEN ISNUMERIC(replace(col2,'T','')) = 1 THEN CONVERT(INT, replace(col2,'T','')) ELSE 0 END,

              replace(col2,'T','')

      Error i am getting

      TEIID31100 Parsing error: Encountered "THEN CONVERT([*]INT[*], replace" at line 7, column 71