Exemplo n.º 1
0
 public TableReference(TableOrViewName ti)
     : this()
 {
     InitializeMembers();
     InterpretTableOrViewName(ti);
 }
Exemplo n.º 2
0
 public static TableOrViewName Create(TableReference tr)
 {
     var res = new TableOrViewName();
     res.tableReference = tr;
     return res;
 }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
 private void InitializeMembers()
 {
     this.tableName = null;
 }
Exemplo n.º 5
0
        public override Node Interpret()
        {
            this.tableName = FindDescendant<TableOrViewName>();

            return base.Interpret();
        }
Exemplo n.º 6
0
 public abstract bool WriteTableOrViewName(TableOrViewName node);
Exemplo n.º 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);
     }
 }