Gets or sets template for SQL SELECT query.
Namespace: NReco.DataAssembly: NReco.Data (in NReco.Data.dll) Version: 1.0.2
public string SelectTemplate { get; set; }
public string SelectTemplate { get; set; }
Public Property SelectTemplate As String
Get
Set
Public Property SelectTemplate As String
Get
Set
public:
property String^ SelectTemplate {
String^ get ();
void set (String^ value);
}
public:
property String^ SelectTemplate {
String^ get ();
void set (String^ value);
}
member SelectTemplate : string with get, set
member SelectTemplate : string with get, set
Property Value
Type:
String
Template is processed with
StringTemplate.
List of available variables:
@columns (comma-separated list of fields from Query or '*')@table (table name, possibly with alias like 'users u')@where (query conditions, may be empty)@orderby (order by expression, may be empty)@recordoffset (starting record index offset, 0 by default)@recordcount (max number of records to return, empty if not specified)@recordtop (recordoffset+recordcount, empty if recordcount is not specified)@<extendedPropertyKey> (value from Query.ExtendedProperties dictionary)
@record* variables are useful for database-specific paging optimizations, for example:
DbCommandBuilder cmdBuilder;
cmdBuilder = "SELECT @recordtop[TOP {0}] @columns FROM @table@where[ WHERE {0}]@orderby[ ORDER BY {0}]";
// MS SQL TOP syntax
DbCommandBuilder cmdBuilder;
cmdBuilder = "SELECT @recordtop[TOP {0}] @columns FROM @table@where[ WHERE {0}]@orderby[ ORDER BY {0}]";
DbCommandBuilder cmdBuilder;
cmdBuilder = "SELECT @columns FROM @table@where[ WHERE {0}]@orderby[ ORDER BY {0}] @recordcount[LIMIT {0}] @recordoffset[OFFSET {0}]";
// PostgreSql LIMIT and OFFSET syntax
DbCommandBuilder cmdBuilder;
cmdBuilder = "SELECT @columns FROM @table@where[ WHERE {0}]@orderby[ ORDER BY {0}] @recordcount[LIMIT {0}] @recordoffset[OFFSET {0}]";
Note that if offset is applied on DB level and
ApplyOffset should be false.