com.sap.sql
Class NoDataException

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

public class NoDataException
extends java.sql.SQLException

Exception thrown by the Open SQL / SQLJ runtime if a single row query returns an empty result set.

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:
CardinalityViolationException, Serialized Form

Field Summary
static java.lang.String SQL_STATE
          SQL state indicating that no data was returned by a single row query.
 
Constructor Summary
NoDataException()
          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 no data was returned by a single row query.
Constructor Detail

NoDataException

public NoDataException()
Constructs a new NoDataException object. This is an SQLException with SQL state "02000" and the text "no data".