Skip to content

[BUG] JSQLParser 4.5/4.6 : RDBMS : extension field exception #1766

Discussion options

You must be logged in to vote

If you use Release 4.6 then your code will look like this:

    @Test
    void testIssue1765() {
        String sqlStr = "INSERT INTO mytable (col1)\n"
                        + "VALUES ( 1 )";

        Select select = new Select()
                                .withSelectBody( new ValuesStatement().addExpressions( new LongValue(1)) );

        Insert insert = new Insert()
                                .withTable( new Table("mytable") )
                                .withColumns( Arrays.asList(new Column("col1")) )
                                .withSelect(  select );

        assertStatementCanBeDeparsedAs(insert, sqlStr,true);
    }

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by licai1210
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1765 on April 18, 2023 04:43.