cube-js/cube · error · Error
Oracle can not work with table names longer than 128 symbols
Error message
Oracle can not work with table names longer than 128 symbols. Consider using the 'sqlAlias' attribute in your cube definition for ${quotedTableName}. What it means
Oracle restricts most identifiers to 128 bytes. OracleDriver.createTable validates the quoted table name length before delegating, and throws with guidance to use the cube's `sqlAlias` attribute when the generated rollup table name is too long.
Source
Thrown at packages/cubejs-oracle-driver/driver/OracleDriver.js:187
* @protected
*/
async withConnection(fn) {
const connection = await this.pool.acquire();
try {
return await fn(connection);
} finally {
await this.pool.release(connection);
}
}
async testConnection() {
await this.query('SELECT 1 FROM DUAL', {});
}
async createTable(quotedTableName, columns) {
if (quotedTableName.length > 128) {
throw new Error('Oracle can not work with table names longer than 128 symbols. ' +
`Consider using the 'sqlAlias' attribute in your cube definition for ${quotedTableName}.`);
}
return super.createTable(quotedTableName, columns);
}
static normalizeParams(query, values) {
if (!values || values.length === 0) {
return { sql: query, binds: {} };
}
const binds = {};
const valueToName = new Map();
let idx = 0;
let nextName = 0;
// `:"?"` must be matched as a whole before a lone `?`, so it appears first
// in the alternation; since it starts with `:`, its inner `?` is consumedView on GitHub (pinned to 7d981676b3)
Solutions
- Add `sqlAlias: 'short_name'` to the cube definition to control the generated table name.
- Shorten the cube or pre-aggregation name in the data model.
- Shorten the target schema or prefix used for rollup tables.
Example fix
// before
cube('EnterpriseFinancialReportingConsolidatedQuarterlyActualsCube', { /* ... */ });
// after
cube('EnterpriseFinancialReportingConsolidatedQuarterlyActualsCube', {
sqlAlias: 'fin_qtr',
/* ... */
}); Defensive patterns
Strategy: validation
Validate before calling
if (quotedTableName.length > 128) {
throw new Error(`Table name exceeds Oracle's 128-char limit: ${quotedTableName}. Add sqlAlias to the cube.`);
} Try / catch
try {
await driver.createTable(name, columns);
} catch (e) {
if (e.message.includes('longer than 128')) {
console.error('Add sqlAlias to the cube definition');
}
throw e;
} Prevention
- Set sqlAlias for long cube names on Oracle deployments.
- Keep generated rollup table names under 128 chars.
- Account for schema-qualified name length in validation.
- Test pre-aggregation uploads in staging with real naming.
When it happens
Trigger: Uploading a pre-aggregation table through `createTable` where the generated quoted table name exceeds 128 characters.
Common situations: Very long cube or pre-aggregation names, multi-tenant prefixes, or long schema-qualified names pushing the identifier over Oracle's limit.
Related errors
- MySQL can not work with table names longer than 64 symbols.
- Oracle can not work with table names that longer than 64 sym
- PostgreSQL can not work with table names longer than 63 symb
- MySQL can not work with table names that longer than 64 symb
- Unable to detect column types for pre-aggregation on empty v
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/2b85f06b5cbc42d5.
Report an issue: GitHub.