0

使用 Firebird 和 .Net Firebird 提供程序。寻找类似的东西:

using (var cmd = new FbCommand()) {

   var parser = new FbParser(someSqlText);

   // Add a filter to the where clause. May need code for adding a "where" if there is none or adding an "and" statement, etc.
   parser.MainWhereClause += "someTable.someField = @someParam";

   // Default some orderby. Add one, etc?
   parser.OrderByClause = parser.OrderByClause ?? "customer.name";

   parser.SelectFields.Add("customer.phone");
   if (parser.GroupByFields.Any()) {
      parser.GroupByFields.Add("customer.phone");
   }

   cmd.CommandText = parser.ToString();

   // FbCommand does have a Prepare() method and that does allow that object to know the parameters, but they are private and not accessible.
   foreach (var parameterName in parser.Parameters) {
      cmd.Parameters.Add(parameterName).Value = GetSomeValue(parameterName);
   }

外面有这样的吗?我正在为其他 SQL 风格找到这个,但没有什么能理解 FB 语法,比如连接、CTE、派生表等。

4

0 回答 0