AppendWhere() public method

public AppendWhere ( string value ) : void
value string
return void
Exemplo n.º 1
0
        protected override SqlClause GetCommandText(object[] restrictions)
        {
            var sql = new SqlClause();

            var col = _sqlClauses.Select("CollectionName = 'Tables' 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);
                }

                // TABLE_TYPE
                if (restrictions.Length >= 4 && restrictions[3] != null)
                {
                    switch (restrictions[3].ToString())
                    {
                    case "VIEW":
                        sql.AppendWhere(col[0]["Where4"].ToString());
                        break;

                    case "SYSTEM TABLE":
                        sql.AppendWhere(col[0]["Where5"].ToString());
                        break;

                    //case "BASE TABLE":
                    default:
                        sql.AppendWhere(col[0]["Where6"].ToString());
                        break;
                    }
                }
            }

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

            return(sql);
        }
Exemplo n.º 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;
		}
Exemplo n.º 3
0
        protected override SqlClause GetCommandText(object[] restrictions)
        {
            var sql = new SqlClause();

            var col = _sqlClauses.Select("CollectionName = 'CheckConstraints' 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);
                }
            }

            return(sql);
        }
Exemplo n.º 4
0
        protected override SqlClause GetCommandText(object[] restrictions)
        {
            var sql = new SqlClause();

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

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

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

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

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

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

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

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

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

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

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

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

            return(sql);
        }