Class TConstraint
- Namespace
- gudusoft.gsqlparser.nodes
- Assembly
- gudusoft.gsqlparser.dll
Use a constraint to define an integrity constraint, a rule that restricts the values in a database.
Oracle Database lets you create six types of constraints and lets you declare them in two ways.
- A NOT NULL constraint prohibits a database value from being null.
- A unique constraint prohibits multiple rows from having the same value in the same column or combination of columns but allows some values to be null. call method ColumnList to result columns of this unique key.
- A primary key constraint combines a NOT NULL constraint and a unique constraint in a single declaration. It prohibits multiple rows from having the same value in the same column or combination of columns and prohibits values from being null. call method ColumnList to result columns of this primary key.
- A foreign key constraint requires values in one table to match values in another table. call method ColumnList to result columns of this foreign key.
- A check constraint requires a value in the database to comply with a specified condition. call method CheckCondition to return this condition.
- A REF column by definition references an object in another object type or in a relational table. A REF constraint lets you further describe the relationship between the REF column and the object it references.
- default constraint is valid in sql server.
public class TConstraint : TParseTreeNode, Visitable
- Inheritance
-
TConstraint
- Implements
- Inherited Members
Properties
AutomaticProperties
public virtual List<TAutomaticProperty> AutomaticProperties { get; set; }
Property Value
CheckCondition
public virtual TExpression CheckCondition { get; set; }
Property Value
- TExpression
used in check constraint, requires a value in the database to comply with this specified condition.
Clustered
public virtual bool Clustered { get; set; }
Property Value
ClusteredToken
public virtual TSourceToken ClusteredToken { set; }
Property Value
ColumnList
public virtual TObjectNameList ColumnList { get; set; }
Property Value
- TObjectNameList
column name list used when constraint type is unique, primary key or foreign key.
ConstraintLevel
public virtual int ConstraintLevel { get; set; }
Property Value
ConstraintName
public virtual TObjectName ConstraintName { get; set; }
Property Value
Constraint_type
public virtual EConstraintType Constraint_type { get; set; }
Property Value
DefaultExpression
public virtual TExpression DefaultExpression { get; set; }
Property Value
DefaultForColumnName
public TObjectName DefaultForColumnName { get; set; }
Property Value
Increment
public virtual TExpression Increment { get; set; }
Property Value
IndexCols
public virtual List<TIndexColName> IndexCols { get; set; }
Property Value
IndexOptionList
public List<TMySQLIndexOption> IndexOptionList { get; set; }
Property Value
KeyActions
public virtual List<TKeyAction> KeyActions { get; set; }
Property Value
NonClustered
public virtual bool NonClustered { get; set; }
Property Value
ReferencedColumnList
public virtual TObjectNameList ReferencedColumnList { get; set; }
Property Value
ReferencedObject
public virtual TObjectName ReferencedObject { get; set; }
Property Value
Seed
public virtual TExpression Seed { get; set; }
Property Value
constraintComment
public TConstant constraintComment { get; set; }
Property Value
Methods
accept(TParseTreeVisitor)
public override void accept(TParseTreeVisitor v)
Parameters
acceptChildren(TParseTreeVisitor)
public override void acceptChildren(TParseTreeVisitor v)
Parameters
doParse(TCustomSqlStatement, ESqlClause)
analyze this node
public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)
Parameters
psqlTCustomSqlStatementplocationESqlClause
init(object)
Initialize a query tree node.
public override void init(object arg1)
Parameters
arg1object
setConstraintName(TObjectName)
public void setConstraintName(TObjectName on)
Parameters
onTObjectName
setConstraint_type(EConstraintType)
public void setConstraint_type(EConstraintType ct)
Parameters
setKeyActions(List<TKeyAction>)
public void setKeyActions(List<TKeyAction> ka)
Parameters
kaList<TKeyAction>
setReferencedColumnList(TObjectNameList)
public void setReferencedColumnList(TObjectNameList onl)
Parameters
onlTObjectNameList
setReferencedObject(TObjectName)
public void setReferencedObject(TObjectName on)
Parameters
onTObjectName