Example #1
0
 public insertselect(ddl db, Fields fields, FieldInfo pk_for_auto_newid_seq)
 {
     Top      = 0;
     Distinct = false;
     Tables   = null;
     Joins    = null;
     Where    = null;
     GroupBy  = null;
     Having   = null;
     OrderBy  = null;
     Fields   = new selectlist();
     foreach (Field f in fields)
     {
         if (pk_for_auto_newid_seq != null && f.Name == pk_for_auto_newid_seq.Name) /* [dlatikay 20110729] we can easily auto-increment for the next free integer PK value herein */
         {
             Fields.Add(new selectfield(new selectstatement(
                                            new selectlist()
             {
                 new selectfield(selectfunctiondef.max_inc, f.Name)
             },
                                            new tableexpressions(pk_for_auto_newid_seq.DeclaringType),
                                            null,
                                            null
                                            ), f.Name));
         }
         else
         {
             Fields.Add(new selectparam(db.MakeParamName(f.Name), f.Name, f.Type, f.Size));
         }
     }
 }
Example #2
0
 public updateselect(ddl db, Fields fields)
 {
     Top      = 0;
     Distinct = false;
     Tables   = null;
     Joins    = null;
     Where    = new whereclause(fields.PKQueryExpression(db));
     GroupBy  = null;
     Having   = null;
     OrderBy  = null;
     Fields   = new selectlist();
     foreach (Field f in fields)
     {
         if (!f.PrimaryKeyConstituent)
         {
             Fields.Add(new selectparam(db.MakeParamName(f.Name), f.Name, f.Type, f.Size));
         }
     }
 }
Example #3
0
 public plainselect_where(string[] fields, string table, whereclause where)
 {
     Top      = 0;
     Distinct = false;
     Tables   = new tableexpressions()
     {
         new tableexpression(table)
     };
     Joins   = null;
     Where   = where;
     GroupBy = null;
     Having  = null;
     OrderBy = null;
     Fields  = new selectlist();
     foreach (string f in fields)
     {
         Fields.Add(new selectfield(f));
     }
 }