2004.04.29


com.jdc.rdb.sql.dml.select
Class Rows

java.lang.Object
  |
  +--com.jdc.lang.Object
        |
        +--com.jdc.rdb.sql.SQLClause
              |
              +--com.jdc.rdb.sql.dml.DMLClause
                    |
                    +--com.jdc.rdb.sql.dml.select.Rows
All Implemented Interfaces:
Clause, SelectClause, Serializable

public class Rows
extends DMLClause
implements SelectClause

Rows represents a Select SQL statement rows clause. The rows clause specifies the rows to retain in the final result Table. Valid options are:

Reference:
IBM® DB2 Universal Database™ SQL Reference Volume 2 Version 8, Page 555.

Version:
2.0
Author:
Jay Damon
See Also:
Select, Serialized Form

Field Summary
static String ALL
          Retains all rows of the final result table and does not eliminate duplicates.
static String DISTINCT
          Eliminates all but one of each set of duplicate rows of the final result table.
 
Fields inherited from class com.jdc.rdb.sql.dml.DMLClause
sqlClause
 
Fields inherited from class com.jdc.lang.Object
string
 
Constructor Summary
Rows()
          Constructs a new Rows clause object.
Rows(String rows)
          Constructs a new Rows clause object for the specified rows to select.
 
Method Summary
 String getValue()
          Returns the Rows clause value.
 Rows setAll()
          Sets the Rows clause to retain all rows of the final result table and does not eliminate duplicates.
 Rows setDistinct()
          Sets the Rows clause to eliminate all but one of each set of duplicate rows of the final result table.
 String toString()
          Returns a String representation of this Rows clause.
 
Methods inherited from class com.jdc.rdb.sql.dml.DMLClause
getKeyword
 
Methods inherited from class com.jdc.rdb.sql.SQLClause
contains, getKeyword, setKeyword, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL

public static final String ALL
Retains all rows of the final result table and does not eliminate duplicates.

See Also:
Constant Field Values

DISTINCT

public static final String DISTINCT
Eliminates all but one of each set of duplicate rows of the final result table.

See Also:
Constant Field Values
Constructor Detail

Rows

public Rows()
Constructs a new Rows clause object.


Rows

public Rows(String rows)
Constructs a new Rows clause object for the specified rows to select. Valid options are ALL or DISTINCT.

Throws:
SQLInvalidException - An invalid rows selection is specified.
See Also:
setAll(), setDistinct()
Method Detail

getValue

public String getValue()
Returns the Rows clause value.

Overrides:
getValue in class SQLClause
Returns:
The Rows clause value.

setAll

public Rows setAll()
Sets the Rows clause to retain all rows of the final result table and does not eliminate duplicates.

Returns:
This Rows clause object.
See Also:
setDistinct

setDistinct

public Rows setDistinct()
Sets the Rows clause to eliminate all but one of each set of duplicate rows of the final result table. Two rows are duplicates of one another only if each value in the first is equal to the corresponding value of the second. For determining duplicates, two null values are considered equal.

Returns:
This Rows clause object.
See Also:
setAll

toString

public String toString()
Returns a String representation of this Rows clause.

Specified by:
toString in interface SelectClause
Overrides:
toString in class SQLClause
Returns:
A String representation of this Rows clause.

2004.04.29



Copyright © 2004 J. Damon & Co.; All Rights Reserved WorldWide.