Version 6.3 - SQL syntax highlight problem

2013-02-28
2013-04-01
  • Jako Grobler

    Jako Grobler - 2013-02-28

    Create a new file with the following lines:

    -- Insert initial settings
    INSERT INTO MYSETTINGS (SETID, VALUE) VALUES ('DASHBOARD','http://dashboard.local');
    INSERT INTO MYSETTINGS (SETID, VALUE) VALUES ('DOCLIB','\gns.local\Shared\Files\%CUSTNMBR%\');
    INSERT INTO MYSETTINGS (SETID,VALUE) VALUES ('APPLDB','DB01');
    INSERT INTO MYSETTINGS (SETID,VALUE) VALUES ('FRANDB','GNSDB');

    Change the language to SQL.
    Now open a new tab in Notepad++.
    Go back to the tab with the SQL.
    The syntax highlight is all wrong from the third line onwards.

     
  • cchris

    cchris - 2013-03-04

    Your code looks wrong indeed. The substring
    MBR%\'
    is interpreted as % followed by an escaped quote, resulting in the string not being properly terminated.
    Problem goes away using MBBR%\' instead. I have no idea whether %\ escapes the backslash, but that's not what the lexer thinks.

    CChris

     
  • Jako Grobler

    Jako Grobler - 2013-03-11

    No, the %\ does not escape the backslash. We use %VALUE% as placeholders for parameters. In SQL '%\' actually means '%\'.

    This is MS SQL Server (T-SQL). It is the same for Oracle. I wonder if the SQL syntax that comes included with Notepad++ is for another SQL dialect where that sequence does indeed mean it is an escape sequence?

     
  • cchris

    cchris - 2013-04-01

    Scintilla comes with 3 SQL lexers,: one is generic, one for MS-SQL and one for MySql. Notepad++ only bundles the first of these.

    Don, including the other two doesn't seem too difficult, is it?

    CChris

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks