private static GetWhereClause ( string initial_where, string keys, string values ) : string | ||
initial_where | string | |
keys | string | |
values | string | |
Результат | string |
private MySqlSchemaCollection GetParametersForRoutineFromIS(string[] restrictions) { string[] keys = new string[] { "SPECIFIC_CATALOG", "SPECIFIC_SCHEMA", "SPECIFIC_NAME", "ROUTINE_TYPE", "PARAMETER_NAME" }; StringBuilder stringBuilder = new StringBuilder("SELECT * FROM INFORMATION_SCHEMA.PARAMETERS"); string whereClause = ISSchemaProvider.GetWhereClause(null, keys, restrictions); if (!string.IsNullOrEmpty(whereClause)) { stringBuilder.AppendFormat(CultureInfo.InvariantCulture, " WHERE {0}", new object[] { whereClause }); } MySqlSchemaCollection mySqlSchemaCollection = base.QueryCollection("parameters", stringBuilder.ToString()); if (mySqlSchemaCollection.Rows.Count != 0 && (string)mySqlSchemaCollection.Rows[0]["routine_type"] == "FUNCTION") { mySqlSchemaCollection.Rows[0]["parameter_mode"] = "IN"; mySqlSchemaCollection.Rows[0]["parameter_name"] = "return_value"; } return(mySqlSchemaCollection); }
private MySqlSchemaCollection Query(string table_name, string initial_where, string[] keys, string[] values) { StringBuilder stringBuilder = new StringBuilder("SELECT * FROM INFORMATION_SCHEMA."); stringBuilder.Append(table_name); string whereClause = ISSchemaProvider.GetWhereClause(initial_where, keys, values); if (whereClause.Length > 0) { stringBuilder.AppendFormat(CultureInfo.InvariantCulture, " WHERE {0}", new object[] { whereClause }); } return(this.GetTable(stringBuilder.ToString())); }