pentaho/pentaho-kettle · error · KettleDatabaseException

Sequences are only available for Oracle databases.

Error message

Sequences are only available for Oracle databases.

What it means

Thrown by Database's sequence-listing method (Database.java:5178, getSequences path) when the connected database is not Oracle. Sequence enumeration via getSequences is implemented only for the Oracle dialect; every other database type is explicitly rejected with this hardcoded message.

Solutions

  1. Only call sequence APIs when databaseMeta.getDatabaseType() == DATABASE_TYPE_ORACLE (or supportsSequences())
  2. For non-Oracle databases with sequences, query catalog metadata directly (e.g. information_schema.sequences for PostgreSQL)
  3. Replace sequence lookup with databaseMeta.getNextSequenceValue alternatives where supported
  4. Use a dedicated plugin/dialect that implements sequence enumeration for your DB
  5. Guard the call: check supportsSequences() before invoking

Example fix

// before
String[] seqs = database.getSequences();
// after
if ( database.getDatabaseMeta().supportsSequences() ) {
  String[] seqs = database.getSequences();
} else {
  // fall back to catalog query or alternative key generation
}
Defensive patterns

Strategy: validation

Validate before calling

if ( databaseMeta.getDatabaseType() != DatabaseMeta.TYPE_DATABASE_ORACLE
  && !databaseMeta.supportsSequences() ) {
  throw new IllegalStateException( "Sequence APIs require Oracle; connected to " + databaseMeta.getPluginName() );
}

Try / catch

try {
  seqs = database.getSequences();
} catch ( KettleDatabaseException e ) {
  if ( !databaseMeta.supportsSequences() ) {
    seqs = listSequencesViaCatalogMetadata( database ); // information_schema fallback
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Calling Database.getSequences() (or methods that enumerate sequences) while databaseMeta is any non-Oracle database type.

Common situations: Portable job/transform metadata built for Oracle executed against PostgreSQL/MySQL/SQL Server; generating sequence SQL on databases where the plugin doesn't implement sequence enumeration even though it has sequences (e.g. PostgreSQL, H2).

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/41d212af82709665. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/database/Database.java:5178

  /**
   * Return all sequence names from connection
   *
   * @return The sequences name list.
   * @throws KettleDatabaseException
   */
  public String[] getSequences() throws KettleDatabaseException {
    if ( databaseMeta.supportsSequences() ) {
      String sql = databaseMeta.getSQLListOfSequences();
      if ( sql != null ) {
        List<Object[]> seqs = getRows( sql, 0 );
        String[] str = new String[ seqs.size() ];
        for ( int i = 0; i < seqs.size(); i++ ) {
          str[ i ] = seqs.get( i )[ 0 ].toString();
        }
        return str;
      }
    } else {
      throw new KettleDatabaseException( "Sequences are only available for Oracle databases." );
    }
    return null;
  }

  @Override
  public String getFilename() {
    return null;
  }

  @Override
  public String getLogChannelId() {
    return log.getLogChannelId();
  }

  @Override
  public String getObjectName() {
    return databaseMeta.getName();
  }

View on GitHub (pinned to f3058517a1)