22 using NUnit.Framework;
24 namespace Deveel.Data.Sql.Statements {
28 using (var session = base.CreateAdminSession(database)) {
29 using (var query = session.CreateQuery()) {
34 query.CreateTable(tableInfo,
false,
false);
39 return base.CreateAdminSession(database);
44 const string sql =
"DECLARE CURSOR c1 INSENSITIVE IS SELECT * FROM test_table WHERE a = 1";
47 Assert.IsNotNull(statements);
49 var statementList = statements.ToList();
50 Assert.IsNotEmpty(statementList);
51 Assert.AreEqual(1, statementList.Count);
55 Assert.AreEqual(
"c1", statement.CursorName);
56 Assert.AreNotEqual(0, (statement.Flags &
CursorFlags.Insensitive));
57 Assert.IsEmpty(statement.Parameters);
62 const string sql =
"DECLARE CURSOR c1 (arg1 INT, arg2 VARCHAR) IS SELECT * FROM test_table WHERE a = arg1";
65 Assert.IsNotNull(statements);
67 var statementList = statements.ToList();
68 Assert.IsNotEmpty(statementList);
69 Assert.AreEqual(1, statementList.Count);
73 Assert.AreEqual(
"c1", statement.CursorName);
74 Assert.IsNotEmpty(statement.Parameters);
77 Assert.IsNotNull(arg1);
78 Assert.AreEqual(
"arg1", arg1.ParameterName);
79 Assert.IsInstanceOf<
NumericType>(arg1.ParameterType);
80 Assert.AreEqual(0, arg1.Offset);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static ObjectName Parse(string s)
Parses the given string into a ObjectName object.
static NumericType Integer()
Describes the name of an object within a database.
The representation of a single database in the system.
Represents the foundation class of SQL statements to be executed.
void AddColumn(ColumnInfo column)
Adds a new column to the table at the last position of the columns list in the table metadata...
An isolated session to a given database for a given user, encapsulating the transaction for operation...
void DeclareCursorWithArguments()
void DeclareInsensitiveCursor_NoArguments()
static StringType String()
IEnumerable< CursorParameter > Parameters
static IEnumerable< SqlStatement > Parse(string sqlSource)
Parses a given string into one of more statements.
override ISession CreateAdminSession(IDatabase database)
Defines the metadata properties of a table existing within a database.