Table of Contents

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

List<TAutomaticProperty>

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

bool

ClusteredToken

public virtual TSourceToken ClusteredToken { set; }

Property Value

TSourceToken

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

int

ConstraintName

public virtual TObjectName ConstraintName { get; set; }

Property Value

TObjectName

Constraint_type

public virtual EConstraintType Constraint_type { get; set; }

Property Value

EConstraintType

DefaultExpression

public virtual TExpression DefaultExpression { get; set; }

Property Value

TExpression

DefaultForColumnName

public TObjectName DefaultForColumnName { get; set; }

Property Value

TObjectName

Increment

public virtual TExpression Increment { get; set; }

Property Value

TExpression

IndexCols

public virtual List<TIndexColName> IndexCols { get; set; }

Property Value

List<TIndexColName>

IndexOptionList

public List<TMySQLIndexOption> IndexOptionList { get; set; }

Property Value

List<TMySQLIndexOption>

KeyActions

public virtual List<TKeyAction> KeyActions { get; set; }

Property Value

List<TKeyAction>

NonClustered

public virtual bool NonClustered { get; set; }

Property Value

bool

ReferencedColumnList

public virtual TObjectNameList ReferencedColumnList { get; set; }

Property Value

TObjectNameList

ReferencedObject

public virtual TObjectName ReferencedObject { get; set; }

Property Value

TObjectName

Seed

public virtual TExpression Seed { get; set; }

Property Value

TExpression

constraintComment

public TConstant constraintComment { get; set; }

Property Value

TConstant

Methods

accept(TParseTreeVisitor)

public override void accept(TParseTreeVisitor v)

Parameters

v TParseTreeVisitor

acceptChildren(TParseTreeVisitor)

public override void acceptChildren(TParseTreeVisitor v)

Parameters

v TParseTreeVisitor

doParse(TCustomSqlStatement, ESqlClause)

analyze this node

public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)

Parameters

psql TCustomSqlStatement
plocation ESqlClause

init(object)

Initialize a query tree node.

public override void init(object arg1)

Parameters

arg1 object

setConstraintName(TObjectName)

public void setConstraintName(TObjectName on)

Parameters

on TObjectName

setConstraint_type(EConstraintType)

public void setConstraint_type(EConstraintType ct)

Parameters

ct EConstraintType

setKeyActions(List<TKeyAction>)

public void setKeyActions(List<TKeyAction> ka)

Parameters

ka List<TKeyAction>

setReferencedColumnList(TObjectNameList)

public void setReferencedColumnList(TObjectNameList onl)

Parameters

onl TObjectNameList

setReferencedObject(TObjectName)

public void setReferencedObject(TObjectName on)

Parameters

on TObjectName

See Also