DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | List of all members
Deveel.Data.Sql.Compile.CursorCompileTests Class Reference
Inheritance diagram for Deveel.Data.Sql.Compile.CursorCompileTests:
Deveel.Data.Sql.Compile.SqlCompileTestBase Deveel.Data.Sql.Compile.AlterTableCompileTests

Public Member Functions

void DeclareCursorWithArguments ()
 
void ImplicitDeclareCursor ()
 
void DeclareCursorWithoutArguments ()
 
void OpenCursorWithArguments ()
 
void OpenCursorSimple ()
 
void CloseCursor ()
 
void FetchNextFromCursorInto ()
 
void FetchNextImplicitCursor ()
 

Additional Inherited Members

- Protected Member Functions inherited from Deveel.Data.Sql.Compile.SqlCompileTestBase
SqlCompileResult Compile (string sql)
 

Detailed Description

Definition at line 10 of file CursorCompileTests.cs.

Member Function Documentation

void Deveel.Data.Sql.Compile.CursorCompileTests.CloseCursor ( )
inline

Definition at line 127 of file CursorCompileTests.cs.

127  {
128  const string sql = "CLOSE test_cursor";
129 
130  var result = Compile(sql);
131 
132  Assert.IsNotNull(result);
133  Assert.IsFalse(result.HasErrors);
134 
135  Assert.IsNotEmpty(result.Statements);
136  Assert.AreEqual(1, result.Statements.Count);
137 
138  var statement = result.Statements.FirstOrDefault();
139 
140  Assert.IsNotNull(statement);
141  Assert.IsInstanceOf<CloseStatement>(statement);
142 
143  var cursorStatement = (CloseStatement) statement;
144  Assert.AreEqual("test_cursor", cursorStatement.CursorName);
145  }
void Deveel.Data.Sql.Compile.CursorCompileTests.DeclareCursorWithArguments ( )
inline

Definition at line 12 of file CursorCompileTests.cs.

12  {
13  const string sql = "DECLARE CURSOR test_cursor (a INT, b VARCHAR) IS SELECT * FROM test_table WHERE test_table.a = a";
14  var result = Compile(sql);
15 
16  Assert.IsNotNull(result);
17  Assert.IsFalse(result.HasErrors);
18 
19  Assert.IsNotEmpty(result.Statements);
20  Assert.AreEqual(1, result.Statements.Count);
21 
22  var statement = result.Statements.FirstOrDefault();
23 
24  Assert.IsNotNull(statement);
25  Assert.IsInstanceOf<DeclareCursorStatement>(statement);
26 
27  var cursorStatement = (DeclareCursorStatement) statement;
28 
29  Assert.AreEqual("test_cursor", cursorStatement.CursorName);
30  Assert.IsNotEmpty(cursorStatement.Parameters);
31  Assert.IsNotNull(cursorStatement.QueryExpression);
32  }
void Deveel.Data.Sql.Compile.CursorCompileTests.DeclareCursorWithoutArguments ( )
inline

Definition at line 59 of file CursorCompileTests.cs.

59  {
60  const string sql = "DECLARE CURSOR test_cursor IS SELECT * FROM test_table WHERE test_table.a > 0";
61 
62  var result = Compile(sql);
63 
64  Assert.IsNotNull(result);
65  Assert.IsFalse(result.HasErrors);
66 
67  Assert.IsNotEmpty(result.Statements);
68  Assert.AreEqual(1, result.Statements.Count);
69 
70  var statement = result.Statements.FirstOrDefault();
71 
72  Assert.IsNotNull(statement);
73  Assert.IsInstanceOf<DeclareCursorStatement>(statement);
74 
75  var cursorStatement = (DeclareCursorStatement) statement;
76 
77  Assert.AreEqual("test_cursor", cursorStatement.CursorName);
78  Assert.IsEmpty(cursorStatement.Parameters);
79  Assert.IsNotNull(cursorStatement.QueryExpression);
80  }
void Deveel.Data.Sql.Compile.CursorCompileTests.FetchNextFromCursorInto ( )
inline

Definition at line 148 of file CursorCompileTests.cs.

148  {
149  const string sql = "FETCH NEXT FROM test_cursor INTO test_table";
150 
151  var result = Compile(sql);
152 
153  Assert.IsNotNull(result);
154  Assert.IsFalse(result.HasErrors);
155 
156  Assert.IsNotEmpty(result.Statements);
157  Assert.AreEqual(1, result.Statements.Count);
158 
159  var statement = result.Statements.FirstOrDefault();
160 
161  Assert.IsNotNull(statement);
162  Assert.IsInstanceOf<FetchStatement>(statement);
163 
164  var cursorStatement = (FetchStatement) statement;
165  Assert.AreEqual("test_cursor", cursorStatement.CursorName);
166  }
void Deveel.Data.Sql.Compile.CursorCompileTests.FetchNextImplicitCursor ( )
inline

Definition at line 169 of file CursorCompileTests.cs.

169  {
170  const string sql = "FETCH NEXT";
171 
172  var result = Compile(sql);
173 
174  Assert.IsNotNull(result);
175  Assert.IsFalse(result.HasErrors);
176 
177  Assert.IsNotEmpty(result.Statements);
178  Assert.AreEqual(1, result.Statements.Count);
179 
180  var statement = result.Statements.FirstOrDefault();
181 
182  Assert.IsNotNull(statement);
183  Assert.IsInstanceOf<FetchStatement>(statement);
184 
185  var cursorStatement = (FetchStatement) statement;
186  Assert.IsNullOrEmpty(cursorStatement.CursorName);
187  }
void Deveel.Data.Sql.Compile.CursorCompileTests.ImplicitDeclareCursor ( )
inline

Definition at line 35 of file CursorCompileTests.cs.

35  {
36  const string sql = "CURSOR test_cursor (a INT, b VARCHAR) IS SELECT * FROM test_table WHERE test_table.a = a";
37 
38  var result = Compile(sql);
39 
40  Assert.IsNotNull(result);
41  Assert.IsFalse(result.HasErrors);
42 
43  Assert.IsNotEmpty(result.Statements);
44  Assert.AreEqual(1, result.Statements.Count);
45 
46  var statement = result.Statements.FirstOrDefault();
47 
48  Assert.IsNotNull(statement);
49  Assert.IsInstanceOf<DeclareCursorStatement>(statement);
50 
51  var cursorStatement = (DeclareCursorStatement) statement;
52 
53  Assert.AreEqual("test_cursor", cursorStatement.CursorName);
54  Assert.IsNotEmpty(cursorStatement.Parameters);
55  Assert.IsNotNull(cursorStatement.QueryExpression);
56  }
void Deveel.Data.Sql.Compile.CursorCompileTests.OpenCursorSimple ( )
inline

Definition at line 105 of file CursorCompileTests.cs.

105  {
106  const string sql = "OPEN test_cursor";
107 
108  var result = Compile(sql);
109 
110  Assert.IsNotNull(result);
111  Assert.IsFalse(result.HasErrors);
112 
113  Assert.IsNotEmpty(result.Statements);
114  Assert.AreEqual(1, result.Statements.Count);
115 
116  var statement = result.Statements.FirstOrDefault();
117 
118  Assert.IsNotNull(statement);
119  Assert.IsInstanceOf<OpenStatement>(statement);
120 
121  var cursorStatement = (OpenStatement) statement;
122  Assert.AreEqual("test_cursor", cursorStatement.CursorName);
123  Assert.IsEmpty(cursorStatement.Arguments);
124  }
void Deveel.Data.Sql.Compile.CursorCompileTests.OpenCursorWithArguments ( )
inline

Definition at line 83 of file CursorCompileTests.cs.

83  {
84  const string sql = "OPEN test_cursor (22, b)";
85 
86  var result = Compile(sql);
87 
88  Assert.IsNotNull(result);
89  Assert.IsFalse(result.HasErrors);
90 
91  Assert.IsNotEmpty(result.Statements);
92  Assert.AreEqual(1, result.Statements.Count);
93 
94  var statement = result.Statements.FirstOrDefault();
95 
96  Assert.IsNotNull(statement);
97  Assert.IsInstanceOf<OpenStatement>(statement);
98 
99  var cursorStatement = (OpenStatement) statement;
100  Assert.AreEqual("test_cursor", cursorStatement.CursorName);
101  Assert.IsNotEmpty(cursorStatement.Arguments);
102  }

The documentation for this class was generated from the following file: