Package com.alibaba.druid.sql.dialect.sqlserver.parser

Examples of com.alibaba.druid.sql.dialect.sqlserver.parser.SQLServerStatementParser.parseStatementList()


                        "\n\t(Location)" + //
                        "\nVALUES" + //
                        "\n(dbo.CreateNewPoint(x, y))";

        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);

        String text = TestUtils.outputSqlServer(stmt);

        Assert.assertEquals(expect, text);
View Full Code Here


public class SQLServerAlterTableTest_6 extends TestCase {

    public void test_alter_first() throws Exception {
        String sql = "ALTER TABLE MyTable ALTER COLUMN NullCOl NVARCHAR(20) NOT NULL";
        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);

        SQLServerSchemaStatVisitor visitor = new SQLServerSchemaStatVisitor();
        stmt.accept(visitor);
View Full Code Here

                        "\tORDER BY name ASC\n" + //
                        "\t) sq\n" + //
                        "ORDER BY name DESC";

        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);

        String text = TestUtils.outputSqlServer(stmt);

        Assert.assertEquals(expect, text);
View Full Code Here

        String sql = "SELECT TOP 10 * FROM T";

        String expect = "SELECT TOP 10 *\nFROM T";

        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLSelectStatement stmt = (SQLSelectStatement) parser.parseStatementList().get(0);

        String text = TestUtils.outputSqlServer(stmt);

        Assert.assertEquals(expect, text);

View Full Code Here

                + "impl_class NVARCHAR(255), lower_impl_class NVARCHAR(255), " //
                + "directory_type NVARCHAR(60), directory_position NUMERIC, "//
                + "CONSTRAINT PK_cwd_directory PRIMARY KEY (ID))";

        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLCreateTableStatement stmt = (SQLCreateTableStatement) statementList.get(0);

        Assert.assertEquals(1, statementList.size());

        String output = SQLUtils.toSQLString(stmt, JdbcConstants.SQL_SERVER);
View Full Code Here

            "\n\t\t) b" +
            "\nWHERE a.FId = b.FId" +
            "\nAND a.FId = ?";

        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);

        String text = TestUtils.outputSqlServer(stmt);

        Assert.assertEquals(expect, text);
View Full Code Here

            "\n\t\tAND Sales.SalesPerson.SalesPersonID = so.SalesPersonID" +
            "\n\tGROUP BY so.SalesPersonID" +
            "\n\t)";

        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);

        String text = TestUtils.outputSqlServer(stmt);

        Assert.assertEquals(expect, text);
View Full Code Here

    }

    @Override
    public List<SQLStatement> explain(MappingEngine engine, String sql) {
        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        return parser.parseStatementList();
    }
}
View Full Code Here

    }

    @Override
    public List<SQLStatement> explain(MappingEngine engine, String sql) {
        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        return parser.parseStatementList();
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.