Пример #1
0
		protected override SqlClause GetCommandText(object[] restrictions)
		{
			var sql = new SqlClause();

			var col = _sqlClauses.Select("CollectionName = 'Triggers' and Version=" + _version.ver1);

			sql.Select = col[0]["SelectMain"].ToString();

			sql.AppendWhere(col[0]["Where1"].ToString());

			if (restrictions != null)
			{
				var index = 0;

				// TABLE_CATALOG
				if (restrictions.Length >= 1 && restrictions[0] != null)
				{}

				// TABLE_SCHEMA
				if (restrictions.Length >= 2 && restrictions[1] != null)
					sql.AppendWhereFormat(CultureInfo.CurrentCulture, col[0]["Where2"].ToString(), index++);

				// TABLE_NAME
				if (restrictions.Length >= 3 && restrictions[2] != null)
					sql.AppendWhereFormat(CultureInfo.CurrentCulture, col[0]["Where3"].ToString(), index++);

				// TRIGGER_NAME
				if (restrictions.Length >= 4 && restrictions[3] != null)
					sql.AppendWhereFormat(CultureInfo.CurrentCulture, col[0]["Where4"].ToString(), index);
			}

			sql.AppendOrder(col[0]["Order1"].ToString());

			return sql;
		}
Пример #2
0
        protected override SqlClause GetCommandText(object[] restrictions)
        {
            var sql = new SqlClause();

            var col = _sqlClauses.Select("CollectionName = 'Triggers' and Version=" + _version.ver1);

            sql.Select = col[0]["SelectMain"].ToString();

            sql.AppendWhere(col[0]["Where1"].ToString());

            if (restrictions != null)
            {
                var index = 0;

                // TABLE_CATALOG
                if (restrictions.Length >= 1 && restrictions[0] != null)
                {
                }

                // TABLE_SCHEMA
                if (restrictions.Length >= 2 && restrictions[1] != null)
                {
                    sql.AppendWhereFormat(CultureInfo.CurrentCulture, col[0]["Where2"].ToString(), index++);
                }

                // TABLE_NAME
                if (restrictions.Length >= 3 && restrictions[2] != null)
                {
                    sql.AppendWhereFormat(CultureInfo.CurrentCulture, col[0]["Where3"].ToString(), index++);
                }

                // TRIGGER_NAME
                if (restrictions.Length >= 4 && restrictions[3] != null)
                {
                    sql.AppendWhereFormat(CultureInfo.CurrentCulture, col[0]["Where4"].ToString(), index);
                }
            }

            sql.AppendOrder(col[0]["Order1"].ToString());

            return(sql);
        }