com.ibm.pdq.runtime.statement

Enum SqlStatementType

  1. java.lang.Object
  2. extended byjava.lang.Enum<SqlStatementType>
  3. extended bycom.ibm.pdq.runtime.statement.SqlStatementType
All implemented interfaces:
Serializable, Comparable<SqlStatementType>

public enum SqlStatementType
extends Enum<SqlStatementType>
Describes the type of an SQL statement.

Enum Constant Summary

Enum Constant and Description
ALTER
CALL
COMMENT
COMPOUND
The SQL statement starts with "BEGIN".
CREATE
DECLAREGLOBALTEMPTABLE
The SQL statement starts with "DECLARE GLOBAL".
DELETE
DROP
GRANT
INSERT
LABEL
MERGE
OTHERSQL
QUERY
The SQL statement starts with "SELECT", "WITH".
RENAME
REVOKE
SET
SET_METHOD
SINGLE_ROW_QUERY
Deprecated.
UPDATE
VALUES
XQUERY

Method Summary

Modifier and Type Method and Description
  1. static
  2. SqlStatementType
getSqlStatementType(String type)
  1. static
  2. boolean
isDDL(SqlStatementType type)
  1. static
  2. boolean
isSELECTorVALUES(SqlStatementType type)
To the pureQuery API, this method is equivalent to QUERY before the changes for RTC 8398.
  1. static
  2. boolean
isSELECTorVALUESorXQUERY(SqlStatementType type)
To the pureQuery API, this method is equivalent to isQuery() before the changes for RTC 8398.
  1. static
  2. boolean
isSELECTorXQUERY(SqlStatementType type)
To the Client Optimizer, this method is equivalent to isQuery().
  1. boolean
isSqlSetOrSetMethod()
  1. static
  2. SqlStatementType
valueOf(String name)
Returns the enum constant of this type with the specified name.
  1. static
  2. SqlStatementType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

ALTER

public static final SqlStatementType ALTER

CALL

public static final SqlStatementType CALL

COMMENT

public static final SqlStatementType COMMENT

COMPOUND

public static final SqlStatementType COMPOUND
The SQL statement starts with "BEGIN".

CREATE

public static final SqlStatementType CREATE

DECLAREGLOBALTEMPTABLE

public static final SqlStatementType DECLAREGLOBALTEMPTABLE
The SQL statement starts with "DECLARE GLOBAL".

DELETE

public static final SqlStatementType DELETE

DROP

public static final SqlStatementType DROP

GRANT

public static final SqlStatementType GRANT

INSERT

public static final SqlStatementType INSERT

LABEL

public static final SqlStatementType LABEL

MERGE

public static final SqlStatementType MERGE

OTHERSQL

public static final SqlStatementType OTHERSQL

QUERY

public static final SqlStatementType QUERY
The SQL statement starts with "SELECT", "WITH".

(Note that SQLs that start with "WITH" also contain "SELECT". "WITH" clauses are optional modifiers on SELECT statements. For example: http://publib.boulder.ibm.com/infocenter/dzichelp/ v2r2/topic/com.ibm.db2z9.doc.sqlref/src/tpc/db2z_sql_selectstatement.htm

For the pureQuery API, before RTC 8389, this also included SQL statements that started with "VALUES".


RENAME

public static final SqlStatementType RENAME

REVOKE

public static final SqlStatementType REVOKE

SET

public static final SqlStatementType SET

SET_METHOD

public static final SqlStatementType SET_METHOD

SINGLE_ROW_QUERY

@Deprecated


public static final SqlStatementType SINGLE_ROW_QUERY
Deprecated.

UPDATE

public static final SqlStatementType UPDATE

VALUES

public static final SqlStatementType VALUES

XQUERY

public static final SqlStatementType XQUERY

Method Detail

getSqlStatementType

public static SqlStatementType getSqlStatementType(
String type)

isDDL

public static boolean isDDL(SqlStatementType type)

isSELECTorVALUES

public static boolean isSELECTorVALUES(
SqlStatementType type)
To the pureQuery API, this method is equivalent to QUERY before the changes for RTC 8398.

Before RTC 8398, QUERY meant SELECT/VALUES for the API, and it only meant SELECT for CO. In 8398, it started representing only SELECT for both of them. It is convenient to have a method that can be used in the cases where the pureQuery API used QUERY before 8398.


isSELECTorVALUESorXQUERY

public static boolean isSELECTorVALUESorXQUERY(
SqlStatementType type)
To the pureQuery API, this method is equivalent to isQuery() before the changes for RTC 8398.

isQuery() check for #QUERY or {@link #XQUERY}. Before RTC 8398, {@link #QUERY} meant SELECT/VALUES for the API, and it only meant SELECT for CO. In 8398, it started representing only SELECT for both of them. It is convenient to have a method that can be used in the cases were the API used {@link #isQuery()} before 8398.


isSELECTorXQUERY

public static boolean isSELECTorXQUERY(
SqlStatementType type)
To the Client Optimizer, this method is equivalent to isQuery().

In RTC 8398, isQuery() was deprecated because we had too many conflicting definitions of "query". It is convenient to have a method that can be used in all the cases where the client optimizer used isQuery() before 8398.


isSqlSetOrSetMethod

public boolean isSqlSetOrSetMethod(
)

valueOf

public static SqlStatementType valueOf(
String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

values

public static SqlStatementType[] values(
)
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SqlStatementType c : SqlStatementType.values())   
System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared