Ejemplo n.º 1
0
		public MetaViewCollection GetViews (bool includeSystem) 
		{
			if (con.State != ConnectionState.Open)
				con.Open();

			MetaViewCollection views = new MetaViewCollection ();

			string where = "'V'";

			string sql = 
				"SELECT su.name AS owner, so.name as table_name, so.id as table_id, " +
				" so.crdate as created_date, so.xtype as table_type " +
				"FROM dbo.sysobjects so, dbo.sysusers su " +
				"WHERE xtype IN (" + where + ") " +
				"AND su.uid = so.uid " +
				"ORDER BY 1, 2";

			IDbCommand cmd = con.CreateCommand ();
			cmd.CommandText = sql;

			IDataReader reader = cmd.ExecuteReader ();
			while (reader.Read ()) {
				MetaView view = new MetaView (reader.GetString (0),
					reader.GetString (1));
				views.Add (view);
			}
			reader.Close ();
			reader = null;

			return views;
		}
Ejemplo n.º 2
0
		public MetaViewCollection GetViews (bool includeSystem) 
		{
			if (con.State != ConnectionState.Open)
				con.Open();

			MetaViewCollection views = new MetaViewCollection ();

			string where = "";
			if (includeSystem == true)
				where = "";
			else
				where = "WHERE OWNER NOT IN ('SYS','SYSTEM','MDSYS','CTXSYS','WMSYS','WKSYS')";

			string sql = "SELECT OWNER, VIEW_NAME " +
				"FROM ALL_VIEWS " +
				where +
				" ORDER BY 1, 2";

			IDbCommand cmd = con.CreateCommand ();
			cmd.CommandText = sql;

			IDataReader reader = cmd.ExecuteReader ();
			while (reader.Read ()) {
				MetaView view = new MetaView (reader.GetString (0),
					reader.GetString (1));
				views.Add (view);
			}
			reader.Close ();
			reader = null;
			
			return views;
		}
Ejemplo n.º 3
0
        public MetaViewCollection GetViews(bool includeSystem)
        {
            if (con.State != ConnectionState.Open)
            {
                con.Open();
            }

            MetaViewCollection views = new MetaViewCollection();

            string sql =
                "select schemaname, viewname " +
                "from pg_views";

            sql = sql + " ORDER BY 1,2";

            IDbCommand cmd = con.CreateCommand();

            cmd.CommandText = sql;

            IDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                MetaView view = new MetaView(reader.GetString(0), reader.GetString(1));
                views.Add(view);
            }
            reader.Close();
            reader = null;

            return(views);
        }
Ejemplo n.º 4
0
        public MetaViewCollection GetViews(bool includeSystem)
        {
            if (con.State != ConnectionState.Open)
            {
                con.Open();
            }

            MetaViewCollection views = new MetaViewCollection();

            string sql =
                "SELECT su.name AS owner, so.name as table_name, so.id as table_id, " +
                " so.crdate as created_date, so.type as table_type " +
                "FROM dbo.sysobjects so, dbo.sysusers su " +
                "WHERE type = 'V' " +
                "AND su.uid = so.uid " +
                "ORDER BY 1, 2";

            IDbCommand cmd = con.CreateCommand();

            cmd.CommandText = sql;

            IDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                MetaView view = new MetaView(reader.GetString(0),
                                             reader.GetString(1));
                views.Add(view);
            }
            reader.Close();
            reader = null;

            return(views);
        }
Ejemplo n.º 5
0
		public MetaViewCollection GetViews (bool includeSystem) 
		{
			if (con.State != ConnectionState.Open)
				con.Open ();

			MetaViewCollection views = new MetaViewCollection ();

			string sql = 
				"select schemaname, viewname " +
				"from pg_views";

			sql = sql + " ORDER BY 1,2";

			IDbCommand cmd = con.CreateCommand ();
			cmd.CommandText = sql;

			IDataReader reader = cmd.ExecuteReader ();
			while (reader.Read ()) {
				MetaView view = new MetaView (reader.GetString (0), reader.GetString (1));
				views.Add (view);
			}
			reader.Close ();
			reader = null;
			
			return views;
		}
Ejemplo n.º 6
0
		public MetaViewCollection GetViews (bool includeSystem) 
		{
			if(con.State != ConnectionState.Open)
				con.Open();

			MetaViewCollection views = new MetaViewCollection ();

			if (!infoSchemaExists)
				return views;

			string sql = "select table_schema, table_name, " +
					" view_definition from INFORMATION_SCHEMA.VIEWS;";

			IDbCommand cmd = con.CreateCommand ();
			cmd.CommandText = sql;

			IDataReader reader = cmd.ExecuteReader ();
			while (reader.Read ()) {
				MetaView view = new MetaView (reader.GetString (0),
					reader.GetString (1));
				views.Add (view);
			}
			reader.Close ();
			reader = null;
			
			return views;


		}
Ejemplo n.º 7
0
        public MetaViewCollection GetViews(bool includeSystem)
        {
            if (con.State != ConnectionState.Open)
            {
                con.Open();
            }

            MetaViewCollection views = new MetaViewCollection();

            if (!infoSchemaExists)
            {
                return(views);
            }

            string sql = "select table_schema, table_name, " +
                         " view_definition from INFORMATION_SCHEMA.VIEWS;";

            IDbCommand cmd = con.CreateCommand();

            cmd.CommandText = sql;

            IDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                MetaView view = new MetaView(reader.GetString(0),
                                             reader.GetString(1));
                views.Add(view);
            }
            reader.Close();
            reader = null;

            return(views);
        }
Ejemplo n.º 8
0
        public MetaViewCollection GetViews(bool includeSystem)
        {
            if (con.State != ConnectionState.Open)
            {
                con.Open();
            }

            MetaViewCollection views = new MetaViewCollection();

            string where = "";
            if (includeSystem == true)
            {
                where = "";
            }
            else
            {
                where = "WHERE OWNER NOT IN ('SYS','SYSTEM','MDSYS','CTXSYS','WMSYS','WKSYS')";
            }

            string sql = "SELECT OWNER, VIEW_NAME " +
                         "FROM ALL_VIEWS " +
                         where +
                         " ORDER BY 1, 2";

            IDbCommand cmd = con.CreateCommand();

            cmd.CommandText = sql;

            IDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                MetaView view = new MetaView(reader.GetString(0),
                                             reader.GetString(1));
                views.Add(view);
            }
            reader.Close();
            reader = null;

            return(views);
        }
Ejemplo n.º 9
0
        public MetaViewCollection GetViews(bool includeSystem)
        {
            if (con.State != ConnectionState.Open)
            {
                con.Open();
            }

            MetaViewCollection views = new MetaViewCollection();

            DataTable table2 = GetSchema("Views", new string[] { null, null, null });

            for (int r = 0; r < table2.Rows.Count; r++)
            {
                DataRow  row2     = table2.Rows[r];
                string   viewName = row2["VIEW_NAME"].ToString();
                MetaView view     = new MetaView(viewName);
                views.Add(view);
            }

            return(views);
        }
Ejemplo n.º 10
0
		public MetaViewCollection GetViews (bool includeSystem) 
		{
			if (con.State != ConnectionState.Open)
				con.Open();

			MetaViewCollection views = new MetaViewCollection ();

			DataTable table2 = GetSchema ("Views", new string[] {null, null, null});
			for (int r = 0; r < table2.Rows.Count; r++) {
				DataRow row2 = table2.Rows[r];
				string viewName = row2["VIEW_NAME"].ToString();
				MetaView view = new MetaView (viewName);
				views.Add (view);
			}

			return views;
		}