How can we help you today? How can we help you today?

BUG?: Syntax Error when using alias

Refactor thinks that the following code has syntax errors:
SELECT DISTINCT S.StudentID
 FROM   Student S
 ORDER BY  S.StudentID DESC

If I remove the S alias, everyting works.
tulu
0

Comments

3 comments

  • Andras B
    tulu wrote:
    Refactor thinks that the following code has syntax errors:
    SELECT DISTINCT S.StudentID
     FROM   Student S
     ORDER BY  S.StudentID DESC
    

    If I remove the S alias, everyting works.

    It looks very strange. The above script seems to work for us, so it could be that the error is detected somewhere else, and it is displayed in the wrong location. Do you experience this problem when you have only the above code in the editor window, or does it happen when you have more code in the same editor? Also, which refactoring are you trying to apply to it?

    Andras
    Andras B
    0
  • tulu
    Happens while trying to Layout code. Strange thing is, your sample code works well:
    SELECT  staffId, staffName,  grossSalary
    FROM    [dbo].[personnel]
    WHERE   ( type = 'm' OR type = 'n'
            ) AND grossSalary > @minSalary * 2
    
    is translated to:
    SELECT  staffId,
            staffName,
            grossSalary
    FROM    [dbo].[personnel]
    WHERE   ( type = 'm'
              OR type = 'n'
            )
            AND grossSalary > @minSalary * 2
    

    But my code is marked with all red underlining. (There must be a description for those red underlining somewhere, but I am unable to find it)

    The only thing I suspect may be related to system locale, (We use turkish 1254 codepage, and in that code page, uppercase(i) is not I. We have met problems related to that before.
    tulu
    0
  • Andras B
    tulu wrote:
    ...
    The only thing I suspect may be related to system locale, (We use turkish 1254 codepage, and in that code page, uppercase(i) is not I. We have met problems related to that before.

    It is indeed the locale. It looks like that in your code the character "I" is not the ASCII one, but another unicode character. We will handle these in the next version.

    Thanks,
    Andras
    Andras B
    0

Add comment

Please sign in to leave a comment.