Table of Contents

Class TTypeName

Namespace
gudusoft.gsqlparser.nodes
Assembly
gudusoft.gsqlparser.dll

This class represents SQL Datatype. call method String will return string representation of datatype including type name,length,precision,scale and attributes

  • typename
  • typename(length)
  • typename(precision,scale)

datetype attribute
In datatype like this: MEDIUMTEXT [CHARACTER SET cs_name] [COLLATE collation_name], CHARACTER SET and COLLATE were treated as attribute of the MEDIUMTEXT datatype,those attributes can be fetched from DatatypeAttributeList. For more detailed information about attributes in datatype, please check TDatatypeAttribute.

method DatatypeAttributeList can be used to get datatype attribute such as FORMAT 'yyyymmdd' of DATE in this fuction: CAST('20120802' AS DATE FORMAT 'yyyymmdd').

BINARY

BOOLEAN

CHARACTER STRING

  • CHAR[(n)]/CHARACTER[(n)]
  • CHARACTER VARYING(n)/VARCHAR(n)/CHAR VARYING(n)/VARCHAR2(n) (Oracle)
  • NATIONAL CHARACTER[(n)]/NATIONAL CHAR[(n)]/NCHAR[(n)]
  • NATIONAL CHARACTER VARYING(n)/NATIONAL CHAR VARYING(n)/NCHAR VARYING(n)/NVARCHAR/VARGRAPHIC(n)
  • NVARCHAR2(n) (Oracle)
  • CHARACTER LARGE OBJECT/CLOB
  • NATIONAL CHARACTER LARGE OBJECT
  • NCLOB
  • DBCLOB
  • NTEXT/NATIONAL TEXT(SQL Server)
  • TEXT
  • CHAR FOR BIT DATA
  • VARCHAR FOR BIT DATA
  • TINYTEXT(MySQL)

DATALINK

INTERVAL

COLLECTION

  • ARRAY
  • MULTISET

NUMERIC

TEMPORAL

XML

  • XML
  • XMLTYPE(Oracle)

HIVE array <T>

OTHERS

  • BFILE(Oracle)
  • BIT(MySQL,PostgreSQL,SQL Server)
  • BITVARYING/VARBIT(PostgreSQL)
  • BOX(PostgreSQL)
  • CIDR(PostgreSQL)
  • CIRCLE(PostgreSQL)
  • CURSOR(SQL Server)
  • ENUM(MySQL, PostgreSQL)
  • GEOGRAPHY(SQL Server)
  • GEOMETRY(SQL Server)
  • HIERARCHYID(SQL Server)
  • INET(PostgreSQL)
  • LINE(PostgreSQL)
  • LONG(Oracle)
  • LONG VARCHAR
  • LONG VARGRAPHIC
  • LONGTEXT(MySQL)
  • LSEG(PostgreSQL)
  • MACADDR(PostgreSQL)
  • MEDIUMBLOB(MySQL)
  • MEDIUMTEXT(MySQL)
  • MONEY(PostgreSQL,SQL Server)
  • OID(PostgreSQL)
  • PATH(PostgreSQL)
  • POINT(PostgreSQL)
  • POLYGON(PostgreSQL)
  • RAW(Oracle)
  • ROWID(Oracle)
  • ROWVERSION(SQL Server)
  • SERIAL, SERIAL4(MySQL,PostgreSQL)
  • SERIAL8, BIGSERIAL(PostgreSQL)
  • SET(MySQL)
  • SMALLMONEY(SQL Server)
  • SQL_VARIANT(SQL Server)
  • TABLE(SQL Server)
  • UNIQUEIDENTIFIER(SQL Server)
  • UROWID(Oracle)

datatypes optional attributes:

  • NSIGNED (MySQL)
  • ZEROFILL (MySQL)
  • CHARACTER SET cs_name (MySQL)
  • COLLATE collation_name (MySQL)
public class TTypeName : TParseTreeNode, Visitable
Inheritance
TTypeName
Implements
Inherited Members

Fields

lfdBfile

public const int lfdBfile = 79

Field Value

int

lfdBigInt

public const int lfdBigInt = 45

Field Value

int

lfdBinary

public const int lfdBinary = 34

Field Value

int

lfdBinaryInteger

public const int lfdBinaryInteger = 107

Field Value

int

lfdBinaryLargeObject

public const int lfdBinaryLargeObject = 102

Field Value

int

lfdBit

public const int lfdBit = 22

Field Value

int

lfdBlob

public const int lfdBlob = 76

Field Value

int

lfdBoolean

public const int lfdBoolean = 23

Field Value

int

lfdByte

public const int lfdByte = 143

Field Value

int

lfdByteint

public const int lfdByteint = 120

Field Value

int

lfdChar

public const int lfdChar = 47

Field Value

int

lfdCharLargeObject

public const int lfdCharLargeObject = 171

Field Value

int

lfdCharVarying

public const int lfdCharVarying = 146

Field Value

int

lfdCharacter

public const int lfdCharacter = 46

Field Value

int

lfdCharacterLargeObject

public const int lfdCharacterLargeObject = 148

Field Value

int

lfdCharacterVarying

public const int lfdCharacterVarying = 145

Field Value

int

lfdClob

public const int lfdClob = 77

Field Value

int

lfdDBClob

public const int lfdDBClob = 172

Field Value

int
public const int lfdDatalink = 106

Field Value

int

lfdDate

public const int lfdDate = 63

Field Value

int

lfdDatetime

public const int lfdDatetime = 69

Field Value

int

lfdDec

public const int lfdDec = 10

Field Value

int

lfdDecimal

public const int lfdDecimal = 9

Field Value

int

lfdDoublePrecision

public const int lfdDoublePrecision = 8

Field Value

int

lfdEnum

public const int lfdEnum = 91

Field Value

int

lfdFloat

public const int lfdFloat = 4

Field Value

int

lfdGeneric

public const int lfdGeneric = 3

Field Value

int

lfdGeoGraphy

public const int lfdGeoGraphy = 151

Field Value

int

lfdGeoMetry

public const int lfdGeoMetry = 150

Field Value

int

lfdGraphic

public const int lfdGraphic = 103

Field Value

int

lfdInt

public const int lfdInt = 40

Field Value

int

lfdInteger

public const int lfdInteger = 14

Field Value

int

lfdInterval

public const int lfdInterval = 181

Field Value

int

lfdIntervalDTS

public const int lfdIntervalDTS = 72

Field Value

int

lfdIntervalDay

public const int lfdIntervalDay = 133

Field Value

int

lfdIntervalDayToHour

public const int lfdIntervalDayToHour = 134

Field Value

int

lfdIntervalDayToMinute

public const int lfdIntervalDayToMinute = 135

Field Value

int

lfdIntervalDayToSecond

public const int lfdIntervalDayToSecond = 136

Field Value

int

lfdIntervalHour

public const int lfdIntervalHour = 137

Field Value

int

lfdIntervalHourToMinute

public const int lfdIntervalHourToMinute = 138

Field Value

int

lfdIntervalHourToSecond

public const int lfdIntervalHourToSecond = 139

Field Value

int

lfdIntervalMinute

public const int lfdIntervalMinute = 140

Field Value

int

lfdIntervalMinuteToSecond

public const int lfdIntervalMinuteToSecond = 141

Field Value

int

lfdIntervalMonth

public const int lfdIntervalMonth = 132

Field Value

int

lfdIntervalSecond

public const int lfdIntervalSecond = 142

Field Value

int

lfdIntervalYTM

public const int lfdIntervalYTM = 71

Field Value

int

lfdIntervalYear

public const int lfdIntervalYear = 130

Field Value

int

lfdIntervalYearToMonth

public const int lfdIntervalYearToMonth = 131

Field Value

int

lfdLong

public const int lfdLong = 73

Field Value

int

lfdLongRaw

public const int lfdLongRaw = 75

Field Value

int

lfdLongVarGraphic

public const int lfdLongVarGraphic = 105

Field Value

int

lfdLongblob

public const int lfdLongblob = 83

Field Value

int

lfdLongtext

public const int lfdLongtext = 89

Field Value

int

lfdLongvarbinary

public const int lfdLongvarbinary = 57

Field Value

int

lfdLongvarchar

public const int lfdLongvarchar = 56

Field Value

int

lfdMediumblob

public const int lfdMediumblob = 82

Field Value

int

lfdMediumtext

public const int lfdMediumtext = 88

Field Value

int

lfdNClob

public const int lfdNClob = 78

Field Value

int

lfdNationalChar

public const int lfdNationalChar = 61

Field Value

int

lfdNationalCharVarying

public const int lfdNationalCharVarying = 162

Field Value

int

lfdNchar

public const int lfdNchar = 62

Field Value

int

lfdNcharVarying

public const int lfdNcharVarying = 163

Field Value

int

lfdNum

public const int lfdNum = 13

Field Value

int

lfdNumeric

public const int lfdNumeric = 11

Field Value

int

lfdPeriod

public const int lfdPeriod = 147

Field Value

int

lfdPlsInteger

public const int lfdPlsInteger = 108

Field Value

int

lfdRaw

public const int lfdRaw = 74

Field Value

int

lfdReal

public const int lfdReal = 42

Field Value

int

lfdRowTypeAtribute

plsql rowtype atribute

public const int lfdRowTypeAtribute = 108

Field Value

int

lfdSet

public const int lfdSet = 164

Field Value

int

lfdSmallint

public const int lfdSmallint = 41

Field Value

int

lfdText

public const int lfdText = 85

Field Value

int

lfdTime

public const int lfdTime = 68

Field Value

int

lfdTimeStampWithLTZ

public const int lfdTimeStampWithLTZ = 66

Field Value

int

lfdTimeStampWithTZ

public const int lfdTimeStampWithTZ = 65

Field Value

int

lfdTimeWithTZ

public const int lfdTimeWithTZ = 121

Field Value

int

lfdTimestamp

public const int lfdTimestamp = 64

Field Value

int

lfdTinyInt

public const int lfdTinyInt = 43

Field Value

int

lfdTinyblob

public const int lfdTinyblob = 81

Field Value

int

lfdTinytext

public const int lfdTinytext = 84

Field Value

int

lfdTypeAtribute

plsql type atribute

public const int lfdTypeAtribute = 107

Field Value

int

lfdURowid

public const int lfdURowid = 90

Field Value

int

lfdUnknown

public const int lfdUnknown = 2

Field Value

int

lfdVarByte

public const int lfdVarByte = 144

Field Value

int

lfdVarGraphic

public const int lfdVarGraphic = 104

Field Value

int

lfdVarbinary

public const int lfdVarbinary = 33

Field Value

int

lfdVarchar

public const int lfdVarchar = 48

Field Value

int

lfdVarchar2

public const int lfdVarchar2 = 49

Field Value

int

lfdYear

public const int lfdYear = 59

Field Value

int

lfdntext

public const int lfdntext = 86

Field Value

int

lfdnumber

public const int lfdnumber = 12

Field Value

int

Properties

Arrays

index value of datetype in PostgreSQL. like this: SimpleTypename ARRAY [n,...].

public virtual List<TIndices> Arrays { get; set; }

Property Value

List<TIndices>

a list of TIndices,

ByteUnit

Obsolete since v3.2.7.0, use charUnitToken instead.

public virtual bool ByteUnit { get; }

Property Value

bool

CharsetAndCollation

public virtual TDummy CharsetAndCollation { set; }

Property Value

TDummy

CharsetName

public virtual string CharsetName { get; set; }

Property Value

string

CharsetNameByToken

public virtual TSourceToken CharsetNameByToken { set; }

Property Value

TSourceToken

ColTypeList

public virtual List<TTypeName> ColTypeList { get; set; }

Property Value

List<TTypeName>

CollationName

public virtual string CollationName { get; set; }

Property Value

string

ColumnDefList

public virtual TColumnDefinitionList ColumnDefList { get; set; }

Property Value

TColumnDefinitionList

DataType

public virtual EDataType DataType { get; set; }

Property Value

EDataType

DataTypeByObjectName

public virtual TObjectName DataTypeByObjectName { set; }

Property Value

TObjectName

DataTypeByToken

public virtual TSourceToken DataTypeByToken { set; }

Property Value

TSourceToken

DataTypeName

public virtual string DataTypeName { get; }

Property Value

string

DataTypeObjectName

public virtual TObjectName DataTypeObjectName { get; }

Property Value

TObjectName

DatatypeAttributeList

public virtual List<TDatatypeAttribute> DatatypeAttributeList { get; set; }

Property Value

List<TDatatypeAttribute>

Length

public virtual TConstant Length { get; set; }

Property Value

TConstant

Max

public virtual TConstant Max { get; set; }

Property Value

TConstant

Precision

public virtual TConstant Precision { get; set; }

Property Value

TConstant

PrecisionScale

public virtual TPrecisionScale PrecisionScale { set; }

Property Value

TPrecisionScale

PrimitiveTypeOfMap

public virtual TTypeName PrimitiveTypeOfMap { get; set; }

Property Value

TTypeName

Reserve

public virtual TConstant Reserve { get; set; }

Property Value

TConstant

Scale

public virtual TConstant Scale { get; set; }

Property Value

TConstant

a value of TConstant, scale value of datatypes such as numeric, float.

SecondsPrecision

public virtual TConstant SecondsPrecision { get; }

Property Value

TConstant

a value of TConstant, typically the second precision value of datatype.

Start

public virtual TConstant Start { get; set; }

Property Value

TConstant

Type

public virtual int Type { get; set; }

Property Value

int

TypeModifiers

public virtual TExpressionList TypeModifiers { set; }

Property Value

TExpressionList

TypeOfList

public virtual TTypeName TypeOfList { get; set; }

Property Value

TTypeName

TypeOfMap

public virtual TTypeName TypeOfMap { get; set; }

Property Value

TTypeName

charUnitToken

public TSourceToken charUnitToken { get; set; }

Property Value

TSourceToken

signedToken

public TSourceToken signedToken { get; set; }

Property Value

TSourceToken

zeroFillToken

public TSourceToken zeroFillToken { get; set; }

Property Value

TSourceToken

Methods

accept(TParseTreeVisitor)

public override void accept(TParseTreeVisitor v)

Parameters

v TParseTreeVisitor

acceptChildren(TParseTreeVisitor)

public override void acceptChildren(TParseTreeVisitor v)

Parameters

v TParseTreeVisitor

init(object)

Initialize a query tree node.

public override void init(object arg1)

Parameters

arg1 object

init(object, object)

public override void init(object arg1, object arg2)

Parameters

arg1 object
arg2 object

init(object, object, object)

public override void init(object arg1, object arg2, object arg3)

Parameters

arg1 object
arg2 object
arg3 object

isCharUnit()

Obsolete since v3.2.7.0, use charUnitToken instead.

public virtual bool isCharUnit()

Returns

bool

isVarying()

public virtual bool isVarying()

Returns

bool

searchTypeByName(string)

public static EDataType searchTypeByName(string typenameStr)

Parameters

typenameStr string

Returns

EDataType

setArrays(List<TIndices>)

public void setArrays(List<TIndices> l)

Parameters

l List<TIndices>

setCharUnit(TSourceToken)

public virtual void setCharUnit(TSourceToken st)

Parameters

st TSourceToken

setDataTypeByToken(TSourceToken)

public void setDataTypeByToken(TSourceToken st)

Parameters

st TSourceToken

setDataTypeInTokens()

used in y file, setup dbobject type of all source tokens consist of this datatype.

public virtual void setDataTypeInTokens()

setType(int)

public void setType(int t)

Parameters

t int

setTypeModifiers(TExpressionList)

public void setTypeModifiers(TExpressionList l)

Parameters

l TExpressionList

setVarying(TSourceToken)

public virtual void setVarying(TSourceToken st)

Parameters

st TSourceToken