GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Some SQL server syntax does not support parsing · Issue #1682 · JSQLParser/JSqlParser

Some SQL server syntax does not support parsing #1682

New issue
Copy link
New issue
Copy link
Closed
#1676
Closed
Some SQL server syntax does not support parsing#1682
#1676
Copy link

Description

@SconyHui
SconyHui
opened on Dec 5, 2022
Issue body actions

Hi,
I found it unsupported when parsing part of SQLServer syntax.
example:
1, select [id],[name],[age] from [Student]
Because the column name contains the special symbol "[" or "]"
2, declare @Flag int
set @Flag = 1
Because the column name contains the special symbol "@" in SetStatement
3, begin
...
end
This syntax is not supported
4, use LibName
go
...
go
This syntax is not supported

Activity

  1. manticore-projects commented on Dec 5, 2022

    @manticore-projects
    manticore-projects
    on Dec 5, 2022
    Contributor
    More actions

    Greetings.

    Please use the latest JSQLParser 4.5 or better JSQLParser 4.6 Snapshot since all the Syntax are supported.
    Please refer to https://manticore-projects.com/JSQLParser/usage.html#define-the-parser-features for activation of T-SQL Squared Bracket Quotation.

    If you still face challenges, then please provide the specific query, shortened/simplified as much as possible.

  2. SconyHui commented on Dec 5, 2022

    @SconyHui
    SconyHui
    on Dec 5, 2022
    Author
    More actions

    Yes, I'm using version 4.6

  3. SconyHui commented on Dec 5, 2022

    @SconyHui
    SconyHui
    on Dec 5, 2022
    Author
    More actions

    eg:
    select [id],[name],[age] from [Student]
    image

  4. manticore-projects commented on Dec 5, 2022

    @manticore-projects
    manticore-projects
    on Dec 5, 2022
    Contributor
    More actions

    Please activate SquaredBracket Quotation.

  5. manticore-projects commented on Dec 5, 2022

    @manticore-projects
    manticore-projects
    on Dec 5, 2022
    Contributor
    More actions

    select [id],[name],[age] from [Student]

    You can test it online here.

  6. SconyHui commented on Dec 5, 2022

    @SconyHui
    SconyHui
    on Dec 5, 2022
    Author
    More actions

    Thank you. I'll try

  7. SconyHui commented on Dec 5, 2022

    @SconyHui
    SconyHui
    on Dec 5, 2022
    Author
    More actions

    Thank you. The question has been solved
    But I also have problems using this syntax
    image

  8. manticore-projects commented on Dec 5, 2022

    @manticore-projects
    manticore-projects
    on Dec 5, 2022
    Contributor
    More actions

    SET @localVariable is likely not supported.

    You would either need to contribute a PR or sponsor the implementation.

  9. SconyHui commented on Dec 5, 2022

    @SconyHui
    SconyHui
    on Dec 5, 2022
    Author
    More actions

    I will apply to the company

  10. SconyHui commented on Dec 6, 2022

    @SconyHui
    SconyHui
    on Dec 6, 2022
    Author
    More actions

    Hi,
    Is the combination of BEGIIN END and IF not supported
    image

  11. manticore-projects commented on Dec 6, 2022

    @manticore-projects
    manticore-projects
    on Dec 6, 2022
    Contributor
    More actions

    Greetings.

    Please refer to https://manticore-projects.com/JSQLParser/_static/JSqlParserCC.xhtml#Block

    1. Begin End Blocks of statements are supported

    2. IF ELSE Statements are supported

    However, your example of IF ELSE with BLOCK is not supported.
    It would depend on a major rewrite and/or refactoring since those constructs are MS SQL Server specific.

  12. SconyHui commented on Dec 6, 2022

    @SconyHui
    SconyHui
    on Dec 6, 2022
    Author
    More actions

    Thank you very much. I will find another way to solve this problem

  13. manticore-projects commented on Dec 6, 2022

    @manticore-projects
    manticore-projects
    on Dec 6, 2022 via email
    Contributor
    More actions
    I will provide a correction and improvement in the evening. On 6 Dec 2022 07:32, SconyHui ***@***.***> wrote: Thank you very much. I will find another way to solve this problem —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
  14. manticore-projects
    added 2 commits that reference this issue on Dec 9, 2022

    feat: IF/ELSE statements supports Block

    This issue will close once commit f9eee97 is merged into the 'master' branch.
    f9eee97

    fix: `SET` statement supports `UserVariable`

    This issue will close once commit 42b429f is merged into the 'master' branch.
    42b429f
  15. wumpz commented on Dec 10, 2022

    @wumpz
    wumpz
    on Dec 10, 2022
    Member
    More actions

    @manticore-projects Did he sponsor the set improvement?

  16. manticore-projects commented on Dec 10, 2022

    @manticore-projects
    manticore-projects
    on Dec 10, 2022
    Contributor
    More actions

    @manticore-projects Did he sponsor the set improvement?

    No. :(
    But I have to parse some MS SQL Server scripts for myself and so I did not mind.

  17. wumpz
    closed this as completedin #1676on Dec 22, 2022
  18. wumpz
    added a commit that references this issue on Dec 22, 2022

    Assorted Fixes #4 (#1676)

    This issue will close once commit 8d9db70 is merged into the 'master' branch.
    8d9db70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.