DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
DeclareVariableStatement.cs
Go to the documentation of this file.
1 using System;
2 
5 using Deveel.Data.Types;
6 
7 namespace Deveel.Data.Sql.Statements {
9  public DeclareVariableStatement(string variableName, SqlType variableType) {
10  if (String.IsNullOrEmpty(variableName))
11  throw new ArgumentNullException("variableName");
12  if (variableType == null)
13  throw new ArgumentNullException("variableType");
14 
15  VariableName = variableName;
16  VariableType = variableType;
17  }
18 
19  public string VariableName { get; private set; }
20 
21  public SqlType VariableType { get; private set; }
22 
23  public bool IsConstant { get; set; }
24 
25  public SqlExpression DefaultExpression { get; set; }
26 
27  public bool IsNotNull { get; set; }
28 
30  var statement = new DeclareVariableStatement(VariableName, VariableType);
31  if (DefaultExpression != null)
32  statement.DefaultExpression = DefaultExpression.Prepare(preparer);
33 
34  statement.IsConstant = IsConstant;
35  return statement;
36  }
37 
38  protected override void ExecuteStatement(ExecutionContext context) {
39  throw new NotImplementedException();
40  }
41  }
42 }
A long string in the system.
Represents the foundation class of SQL statements to be executed.
Definition: SqlStatement.cs:32
DeclareVariableStatement(string variableName, SqlType variableType)
An interface used to prepare a SqlExpression object.
Defines the properties of a specific SQL Type and handles the values compatible.
Definition: SqlType.cs:33
object Prepare(IExpressionPreparer preparer)
Converts the underlying value of this instance into an object that can be evaluated by an expression...
Defines the base class for instances that represent SQL expression tree nodes.
override void ExecuteStatement(ExecutionContext context)
A contract for objects that participate to a SqlExpression.Prepare phase of an expression evaluation...
Definition: IPreparable.cs:30