com.sap.sql
Class CardinalityViolationException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.sql.SQLException
                    |
                    +--com.sap.sql.CardinalityViolationException
All Implemented Interfaces:
java.io.Serializable

public class CardinalityViolationException
extends java.sql.SQLException

Exception thrown by the Open SQL / SQLJ runtime if a single row query returns a result set with more than one row.

Typical use:

 try {
    #sql [ctx] { SELECT col INTO :var FROM dbtab };
 } catch (com.sap.sql.NoDataDataException ex) {
    // no data returned by the query
 } catch (com.sap.sql.CardinalityViolationException ex) {
    more than one row returned by the query
 }
 

See Also:
NoDataException, Serialized Form

Field Summary
static java.lang.String SQL_STATE
          SQL state indicating that more than one row was returned by a single row query.
 
Constructor Summary
CardinalityViolationException()
          Constructs a new NoDataException object.
 
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, setNextException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SQL_STATE

public static final java.lang.String SQL_STATE
SQL state indicating that more than one row was returned by a single row query.
Constructor Detail

CardinalityViolationException

public CardinalityViolationException()
Constructs a new NoDataException object. This is an SQLException with SQL state "21000" and the text "cardinality violation".