-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtestWithCheckOption.java
More file actions
28 lines (23 loc) · 1.06 KB
/
Copy pathtestWithCheckOption.java
File metadata and controls
28 lines (23 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package test.db2;
/*
* Date: 11-6-7
*/
import gudusoft.gsqlparser.EDbVendor;
import gudusoft.gsqlparser.ERestrictionType;
import gudusoft.gsqlparser.TGSqlParser;
import gudusoft.gsqlparser.nodes.TRestrictionClause;
import gudusoft.gsqlparser.stmt.TCreateViewSqlStatement;
import junit.framework.TestCase;
public class testWithCheckOption extends TestCase {
public void test1(){
TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvdb2);
sqlparser.sqltext = "CREATE VIEW V2 AS SELECT COL1 FROM V1 WITH check option";
assertTrue(sqlparser.parse() == 0);
TCreateViewSqlStatement createView = (TCreateViewSqlStatement)sqlparser.sqlstatements.get(0);
TRestrictionClause restrictionClause = createView.getRestrictionClause();
assertTrue(restrictionClause.getRestrictionType() == ERestrictionType.withCheckOption);// TRestrictionClause.with_check_option);
//System.out.println(restrictionClause.toString());
//TSelectSqlStatement select = createView.getSubquery();
//System.out.println(select.toString());
}
}