public void GetTable(string tableName, TPCField[] allFields, int offsetFields, int noFields, TPCIndexField[] orderFields, int offsetOrderFields, int noOrderFields) { string query = "SELECT"; #if do_it_with_mssql if (Limit.Length > 0) { query += " " + Limit; } else { query += " TOP 1000"; } #endif string comma = " "; fields = new TPCField[noFields]; for (int i = 0; i < noFields; i++) { fields[i] = allFields[offsetFields + i]; query += comma + fields[i].name; comma = ", "; } dataTableGrid = new DataTableGrid(tableName); dataTableGrid.MakeTableColumns(fields); query += comma + UsId + ", " + TmStamp + " FROM " + tableName; if (Lookup.Length > 0) { query += " " + Lookup; } #if do_it_with_oracle if (Lookup.Length == 0) { query += " WHERE ROWNUM <= 1000"; } #endif if (noOrderFields > 0) { string orderBy = " ORDER BY"; comma = " "; for (int i = 0; i < noOrderFields; i++) { int no = orderFields[offsetOrderFields + i].index; TPCField field = fields[no]; orderBy += comma + field.name; comma = ", "; } query += orderBy; } #if do_it_with_lite3 if (Limit.Length > 0) { query += " " + Limit; } else { query += " LIMIT 1000"; } #endif cursor.Format(query, 0); if (ShowSQL) { LogDebug = query; } cursor.Run(); }
public void GetTable(string tableName, TPCField[] allFields, int offsetFields, int noFields, TPCIndexField[] orderFields, int offsetOrderFields, int noOrderFields) { string query = "SELECT"; string comma = " "; fields = new TPCField[noFields]; for (int i=0; i<noFields; i++) { fields[i] = allFields[offsetFields + i]; query += comma + fields[i].name; comma = ", "; } dataTableGrid = new DataTableGrid(tableName); dataTableGrid.MakeTableColumns(fields); query += comma + UsId + ", " + TmStamp + " FROM " + tableName; if (Lookup.Length > 0) query += " " + Lookup; else query += " WHERE ROWNUM <= 1000"; if (noOrderFields > 0) { string orderBy = " ORDER BY"; comma = " "; for (int i = 0; i < noOrderFields; i++) { int no = orderFields[offsetOrderFields + i].index; TPCField field = fields[no]; orderBy += comma + field.name; comma = ", "; } query += orderBy; } cursor.Format(query, 0); if (ShowSQL) LogDebug = query; cursor.Run(); }