示例#1
0
 public TableReference(TableOrViewName ti)
     : this()
 {
     InitializeMembers();
     InterpretTableOrViewName(ti);
 }
示例#2
0
 public static TableOrViewName Create(TableReference tr)
 {
     var res = new TableOrViewName();
     res.tableReference = tr;
     return res;
 }
示例#3
0
        private void InterpretTableOrViewName(TableOrViewName ti)
        {
            var ds = ti.FindDescendant<DatasetName>();
            datasetName = (ds != null) ? Util.RemoveIdentifierQuotes(ds.Value) : null;

            var dbn = ti.FindDescendant<DatabaseName>();
            databaseName = (dbn != null) ? Util.RemoveIdentifierQuotes(dbn.Value) : null;

            var sn = ti.FindDescendant<SchemaName>();
            schemaName = (sn != null) ? Util.RemoveIdentifierQuotes(sn.Value) : null;

            var tn = ti.FindDescendant<TableName>();
            databaseObjectName = (tn != null) ? Util.RemoveIdentifierQuotes(tn.Value) : null;

            isTableOrView = true;
        }
示例#4
0
 private void InitializeMembers()
 {
     this.tableName = null;
 }
示例#5
0
        public override Node Interpret()
        {
            this.tableName = FindDescendant<TableOrViewName>();

            return base.Interpret();
        }
 public abstract bool WriteTableOrViewName(TableOrViewName node);
示例#7
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="node"></param>
 /// <returns></returns>
 /// <remarks>
 /// Table names are only written by this function when the
 /// table appears in the FROM clause. In all other cases it's
 /// WriteColumnIdentifier that generates the output
 /// </remarks>
 public void WriteTableOrViewName(TableOrViewName node)
 {
     if (resolveNames)
     {
         Writer.Write(GetResolvedTableName(node.TableReference));
     }
     else
     {
         // Fall back to original behavior
         base.WriteNode(node);
     }
 }