Repository navigation
MS SQL Server 2012 specific SET statement #1984
Description
Activity
manticore-projects commented
on Mar 31, 2024 ContributorMore actionsGreetings.
Without at least a Sample SQL there is nothing I can do for you.
For example:
SET IDENTITY_INSERT tb_inter_d2v_transfer on;
INSERT INTO tb_inter_d2v_transfer (
SEQID,
TASKID,
PALNO,
BOXCODE,
OPTYPE,
DETADDRE,
ERRORCODE,
FLAG,
SENDTIME,
WHSEID,
TEMP1,
TEMP2,
TEMP3,
TEMP4,
TEMP5
) values
(
#{item.SEQID},
#{item.TASKID},
#{item.PALNO},
#{item.BOXCODE},
#{item.OPTYPE},
#{item.DETADDRE},
#{item.ERRORCODE},
#{item.FLAG},
#{item.SENDTIME},
#{item.WHSEID},
#{item.TEMP1},
#{item.TEMP2},
#{item.TEMP3},
#{item.TEMP4},
#{item.TEMP5}
)
manticore-projects commented
on Mar 31, 2024 ContributorMore actionsYou are showing 2 statements:
-- this syntax is not supported SET IDENTITY_INSERT tb_inter_d2v_transfer on;
Supported
SETsyntax is shown here: https://manticore-projects.com/JSQLParser/syntax_snapshot.html#set
If you need more than this you would need to provide or sponsor an implementation.-- INSERT is supported INSERT INTO tb_inter_d2v_transfer ( seqid , taskid , palno , boxcode , optype , detaddre , errorcode , flag , sendtime , whseid , temp1 , temp2 , temp3 , temp4 , temp5 ) VALUES ( item.seqid, item.taskid, item.palno , item.boxcode, item.optype, item.detaddre , item.errorcode, item.flag, item.sendtime , item.whseid, item.temp1, item.temp2 , item.temp3, item.temp4, item.temp5 ) ;
- changed the title
[-][BUG] JSQLParser Version : 4.6 RDBMS:Microsoft SQL Server 2012 (SP4) (KB4018073) - 11.0.7001.0 (X64) Aug 15 2017 10:23:29 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 17763: ) (Hypervisor) [/-][+]MS SQL Server 2012 specific `SET` statement[/+]on Mar 31, 2024 Is there a version that supports SET IDENTITY_INSERT tb_inter_d2v_transfer on;
manticore-projects commented
on Mar 31, 2024 ContributorMore actionsUnfortunately not, the
SETstatement will have to be amended for the MS SQL Server specific syntax.manticore-projects commented
on Apr 18, 2024 ContributorMore actionsWith latest JSQLParser 4.10 Snapshot, you can use
UnsupportedStatementas shown below:String sqlStr = "SET IDENTITY_INSERT tb_inter_d2v_transfer on"; Statement statement = CCJSqlParserUtil.parse(sqlStr, parser -> parser.withUnsupportedStatements(true)); Assertions.assertInstanceOf(UnsupportedStatement.class, statement); TestUtils.assertStatementCanBeDeparsedAs(statement, sqlStr, true);
- added a commit that references this issue
on Apr 24, 2024
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "on" "ON"
at line 1, column 47.
Was expecting one of: