You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some SQL server syntax does not support parsing #1682
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
However, your example of IFELSE with BLOCK is not supported.
It would depend on a major rewrite and/or refactoring since those constructs are MS SQL Server specific.
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: ***@***.***>
Activity
manticore-projects commentedon Dec 5, 2022
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.
SconyHui commentedon Dec 5, 2022
Yes, I'm using version 4.6
SconyHui commentedon Dec 5, 2022
eg:

select [id],[name],[age] from [Student]
manticore-projects commentedon Dec 5, 2022
Please activate
SquaredBracketQuotation.manticore-projects commentedon Dec 5, 2022
You can test it online here.
SconyHui commentedon Dec 5, 2022
Thank you. I'll try
SconyHui commentedon Dec 5, 2022
Thank you. The question has been solved

But I also have problems using this syntax
manticore-projects commentedon Dec 5, 2022
SET @localVariableis likely not supported.You would either need to contribute a PR or sponsor the implementation.
SconyHui commentedon Dec 5, 2022
I will apply to the company
SconyHui commentedon Dec 6, 2022
Hi,

Is the combination of BEGIIN END and IF not supported
manticore-projects commentedon Dec 6, 2022
Greetings.
Please refer to https://manticore-projects.com/JSQLParser/_static/JSqlParserCC.xhtml#Block
BeginEndBlocks of statements are supportedIFELSEStatements are supportedHowever, your example of
IFELSEwithBLOCKis not supported.It would depend on a major rewrite and/or refactoring since those constructs are MS SQL Server specific.
SconyHui commentedon Dec 6, 2022
Thank you very much. I will find another way to solve this problem
manticore-projects commentedon Dec 6, 2022
feat: IF/ELSE statements supports Block
fix: `SET` statement supports `UserVariable`
wumpz commentedon Dec 10, 2022
@manticore-projects Did he sponsor the
setimprovement?manticore-projects commentedon Dec 10, 2022
No. :(
But I have to parse some MS SQL Server scripts for myself and so I did not mind.
Assorted Fixes #4 (#1676)