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

Examples of com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser


    public void test_0() throws Exception {
        String sql = //
        "alter tablespace escrow_data add datafile '/opt/oracle/oradata/usoint/f937.dbf' size 4095m autoextend off";

        OracleStatementParser parser = new OracleStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement statemen = statementList.get(0);
        print(statementList);

        Assert.assertEquals(1, statementList.size());
View Full Code Here


public class OracleOutputVisitorTest_dblink extends TestCase {

    public void test_0() throws Exception {
        String sql = "SELECT salary from master@emp";

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

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

        OracleSchemaStatVisitor visitor = new OracleSchemaStatVisitor();
View Full Code Here

public class OracleMergeTest3 extends OracleTest {

    public void test_0() throws Exception {
        String sql = "merge /*+ dynamic_sampling(mm 4) dynamic_sampling_est_cdn(mm) dynamic_sampling(m 4) dynamic_sampling_est_cdn(m) */ into sys.mon_mods_all$ mm using (select m.obj# obj#, m.inserts inserts, m.updates updates, m.deletes deletes, m.flags flags, m.timestamp timestamp, m.drop_segments drop_segments from sys.mon_mods$ m, tab$ t where m.obj# = t.obj# ) v on (mm.obj# = v.obj#) when matched then update set mm.inserts = mm.inserts + v.inserts, mm.updates = mm.updates + v.updates, mm.deletes = mm.deletes + v.deletes, mm.flags = mm.flags + v.flags - bitand(mm.flags,v.flags) /* bitor(mm.flags,v.flags) */, mm.timestamp = v.timestamp, mm.drop_segments = mm.drop_segments + v.drop_segments when NOT matched then insert (obj#, inserts, updates, deletes, timestamp, flags, drop_segments) values (v.obj#, v.inserts, v.updates, v.deletes, sysdate, v.flags, v.drop_segments);";

        OracleStatementParser parser = new OracleStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement statemen = statementList.get(0);
        print(statementList);

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

View Full Code Here

public class OracleOutputVisitorTest_forupdate extends TestCase {

    public void test_0() throws Exception {
        String sql = "SELECT salary from employee for update";

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

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

        OracleSchemaStatVisitor visitor = new OracleSchemaStatVisitor();
View Full Code Here

    public void test_0() throws Exception {
        String sql = "SELECT id, name name from department d" + //
                     "   WHERE d.id = ? order by name desc";

        OracleStatementParser parser = new OracleStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement statemen = statementList.get(0);
        print(statementList);

        Assert.assertEquals(1, statementList.size());
View Full Code Here

                + " T1.MT_ORDER_ID = T2.MT_ORDER_ID" //
                + " and SELLER_SSOID = 1" //
                + " AND T1.MT_ORDER_ID = '1'" //
                + " AND T1.MT_BATCH_ORDER_ID IN '1'"; //

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

        Assert.assertEquals(1, statementList.size());
View Full Code Here

        String sql = //
        "CREATE TABLE games" //
                + "  (scores NUMBER, CONSTRAINT unq_num UNIQUE (scores)" //
                + "   INITIALLY DEFERRED DEFERRABLE);";

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

        Assert.assertEquals(1, statementList.size());
View Full Code Here

    public void test_0() throws Exception {
        String sql = //
        "alter table WRH$_SERVICE_WAIT_CLASS drop partition WRH$_SERVIC_1870432296_13478";

        OracleStatementParser parser = new OracleStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement statemen = statementList.get(0);
        print(statementList);

        Assert.assertEquals(1, statementList.size());
View Full Code Here

public class OracleBlockTest extends OracleTest {

    public void test_0() throws Exception {
        String sql = "BEGIN :RESULT := \"SYS\".\"DBMS_AQ_IMPORT_INTERNAL\".\"AQ_EXPORT_CHECK\"(:arg);  END;";

        OracleStatementParser parser = new OracleStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement statemen = statementList.get(0);
        print(statementList);

        Assert.assertEquals(1, statementList.size());
View Full Code Here

                + "    office    VARCHAR2(10)  CONSTRAINT check_office" //
                + "              CHECK (office IN ('DALLAS','BOSTON'," //
                + "              'PARIS','TOKYO')) " //
                + "              DISABLE); ";

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

        Assert.assertEquals(1, statementList.size());
View Full Code Here

TOP

Related Classes of com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser

Copyright © 2018 www.massapicom. 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.