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

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


    public void test_alter_first() throws Exception {
        String sql = "ALTER TABLE extensions ADD [core] bit";
        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);

        SQLServerSchemaStatVisitor visitor = new SQLServerSchemaStatVisitor();
        stmt.accept(visitor);

        System.out.println("Tables : " + visitor.getTables());
View Full Code Here


    public void test_0() throws Exception {
        String sql = "EXEC sp_rename 'rules.temp_plugin_config_key', 'plugin_config_key'";
        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);

        SQLServerSchemaStatVisitor visitor = new SQLServerSchemaStatVisitor();
        stmt.accept(visitor);

        System.out.println("Tables : " + visitor.getTables());
View Full Code Here

   
    public void test_2() throws Exception {
        String sql = "EXEC @returnstatus = dbo.ufnGetSalesOrderStatusText @Status = 2";
        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);

        SQLServerSchemaStatVisitor visitor = new SQLServerSchemaStatVisitor();
        stmt.accept(visitor);

        System.out.println("Tables : " + visitor.getTables());
View Full Code Here

    public void test_alter_first() throws Exception {
        String sql = "ALTER TABLE dbo.doc_exd WITH NOCHECK " //
                     + "ADD CONSTRAINT exd_check CHECK (column_a > 1) ;";
        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);

        SQLServerSchemaStatVisitor visitor = new SQLServerSchemaStatVisitor();
        stmt.accept(visitor);

        System.out.println("Tables : " + visitor.getTables());
View Full Code Here

    public void test_alter_first() throws Exception {
        String sql = "alter table st_jklsxxb enable constraint FK_ST_xxx_REFERENCE_ST_xxx";
        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);

        SQLServerSchemaStatVisitor visitor = new SQLServerSchemaStatVisitor();
        stmt.accept(visitor);

        System.out.println("Tables : " + visitor.getTables());
View Full Code Here

    public void test_alter_first() throws Exception {
        String sql = "DROP INDEX async_measure_snapshots.async_m_s_snapshot_id";
        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);
        parser.match(Token.EOF);

        SQLServerSchemaStatVisitor visitor = new SQLServerSchemaStatVisitor();
        stmt.accept(visitor);

        System.out.println("Tables : " + visitor.getTables());
View Full Code Here

    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);

        System.out.println("Tables : " + visitor.getTables());
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.