You are here: Symbol Reference > Classes > TCustomGSqlParser Class > public > OnTableToken Event
ContentsIndexHome
PreviousUpNext
TCustomGSqlParser.OnTableToken Event
Pascal
property OnTableToken: TOnTableTokenEvent;
C#
static void OnTableTokenHandler(object o, gudusoft.gsqlparser.TSourceToken st, gudusoft.gsqlparser.TCustomSqlStatement stmt)
Description

 

Fired when a source token that represent a table(or table alias) was found. 

 

Select t1.f1 from t1 

 

t1 in from clause is a main table, while t1 in t1.f1 is a reference table. 

 

sender : TObject; 

If a main table is found, sender is type of TLzTable that represent a table object. and if a reference table is found, sender is type of TLz_Attr which represents a qualified name that including table name. 

 

pToken : TSourceToken

This is the source token that represent table name. 

DBObjType is value of ttObjTable or ttObjTableAlias. 

 

psqlstatement: TCustomSqlStatement 

This is the sql statement where this table in. 

 

See Also

TOnTableTokenEvent

Example

 

select t1.f1, table2.f2 

from table1 t1, table2 

 

Parse this statement, OnTableToken is fired when table1, t1, table2, t1 in t1.f1 and table2 in table2.f2 is found. 

 

table1: 

sender is TLzTable

pToken.DBObjType is ttObjTable 

psqlstatement is the statement of this sql. 

 

t1: 

sender is TLzTable

pToken.DBObjType is ttObjTableAlias 

psqlstatement is the statement of this sql. 

 

table2: 

sender is TLzTable

pToken.DBObjType is ttObjTable 

psqlstatement is the statement of this sql. 

 

t1 in t1.f1: 

sender is TLz_Attr

pToken.DBObjType is ttObjTableAlias 

psqlstatement is the statement of this sql. 

 

table2 in table2.f2 

sender is TLz_Attr

pToken.DBObjType is ttObjTable 

psqlstatement is the statement of this sql. 

 

 

Check demos shipped together with this component.

Gudu software http://www.sqlparser.com
Send comments about this topic.