The SelectStatement class is designed for easy manipulation of SQL SELECT statements. It allows you to perform the following tasks:
To obtain the statement text use the ToString method.
Instances of this class cannot be created directly. To use its functionality, one needs to create an object of a descendant class, like OracleSelectStatement.
This example illustrates how to construct in run time a SelectStatement object the represents the following query:
SELECT Test.td.dname AS Department,td.loc AS Location,te.ename AS Name FROM Test.dept AS td,emp AS te GROUP BY te.empno ORDER BY te.ename
SelectStatement stmt = (SelectStatement) new OracleSelectStatement(); stmt.Columns.Add(new SelectColumn("test", "td", "dname", "Department")); stmt.Columns.Add(new SelectColumn("", "td", "loc", "Location")); stmt.Columns.Add(new SelectColumn("", "te", "ename", "Name")); stmt.Tables.Add(new SelectTable("test", "dept", "td")); stmt.Tables.Add(new SelectTable("", "emp", "te")); stmt.GroupBy.Add(new SelectColumn("", "te", "empno", "")); stmt.OrderBy.Add(new SelectColumn("", "te", "ename", ""));
Dim stmt As SelectStatement = New OracleSelectStatement() stmt.Columns.Add(New SelectColumn("test", "td", "dname", "Department")) stmt.Columns.Add(New SelectColumn("", "td", "loc", "Location")) stmt.Columns.Add(New SelectColumn("", "te", "ename", "Name")) stmt.Tables.Add(New SelectTable("test", "dept", "td")) stmt.Tables.Add(New SelectTable("", "emp", "te")) stmt.GroupBy.Add(New SelectColumn("", "te", "empno", "")) stmt.OrderBy.Add(New SelectColumn("", "te", "ename", ""))
System.Object
Devart.Common.SelectStatement
Devart.Data.Oracle.OracleSelectStatement