{"record":{"id":"342a254a14c2f8e3","repo":"cube-js/cube","slug":"oracle-can-not-work-with-table-names-that-longer-t","errorCode":null,"errorMessage":"Oracle can not work with table names that longer than 64 symbols. Consider using the 'sqlAlias' attribute in your cube and in your pre-aggregation definition for ${name}.","messagePattern":"Oracle can not work with table names that longer than 64 symbols\\. Consider using the 'sqlAlias' attribute in your cube and in your pre-aggregation definition for (.+?)\\.","errorType":"validation","errorClass":"UserError","httpStatus":null,"severity":"error","filePath":"packages/cubejs-schema-compiler/src/adapter/OracleQuery.ts","lineNumber":299,"sourceCode":"    // length, so use the max standard VARCHAR2 size.\n    templates.types.string = 'VARCHAR2(4000)';\n\n    return templates;\n  }\n\n  public newFilter(filter) {\n    return new OracleFilter(this, filter);\n  }\n\n  public unixTimestampSql() {\n    // eslint-disable-next-line quotes\n    return `((cast (systimestamp at time zone 'UTC' as date) - date '1970-01-01') * 86400)`;\n  }\n\n  public preAggregationTableName(cube, preAggregationName, skipSchema) {\n    const name = super.preAggregationTableName(cube, preAggregationName, skipSchema);\n    if (name.length > 128) {\n      throw new UserError(`Oracle can not work with table names that longer than 64 symbols. Consider using the 'sqlAlias' attribute in your cube and in your pre-aggregation definition for ${name}.`);\n    }\n    return name;\n  }\n}\n","sourceCodeStart":281,"sourceCodeEnd":304,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-schema-compiler/src/adapter/OracleQuery.ts#L281-L304","documentation":"Oracle pre-aggregation table name length check. Oracle identifiers are limited to 128 bytes; when the generated pre-aggregation name exceeds that, OracleQuery throws a UserError advising 'sqlAlias'. (The message text still says 64 — a stale copy from the MySQL variant — but the enforced limit is 128.)","triggerScenarios":"preAggregationTableName called with cube + preAggregationName + suffix whose combined length exceeds 128 characters on an Oracle datasource.","commonSituations":"Very long cube names from enterprise schemas; rollup-join generated names that concatenate multiple cube names; moving pre-aggregations from short-named dev cubes to production Oracle schemas.","solutions":["Add sqlAlias to the pre-aggregation definition to force a short table name.","Shorten cube and preAggregationName values in the data model.","Rename the source tables/cubes to compact names.","Ignore the '64' wording in the message; the actual enforced limit here is 128 characters."],"exampleFix":"// before\npreAggregations: { main_by_organization_region_and_calendar_week: {...} }\n// after\npreAggregations: { main_by_organization_region_and_calendar_week: { sqlAlias: 'org_region_week', ... } }","handlingStrategy":"validation","validationCode":"const expectedName = `${cubeName.toLowerCase()}_${preAggName.toLowerCase()}_main`;\nif (expectedName.length > 128) {\n  throw new Error(`Add sqlAlias: Oracle pre-agg table name would be ${expectedName.length} chars (max 128)`);\n}","typeGuard":null,"tryCatchPattern":"try { await compilerApi.preAggregationsSchema(); } catch (e) { if (/Oracle can not work with table names/.test(e.message)) {\n  console.error(`Add sqlAlias to shorten: ${e.message}`); } throw e; }","preventionTips":["Set sqlAlias on pre-aggregations for Oracle datasources by default","Keep cube and pre-aggregation names compact","Validate generated identifier lengths in schema CI checks","Remember the enforced limit is 128 even though the message says 64"],"tags":["oracle","pre-aggregation","identifier-length"],"backgroundTag":"table-name-too-long","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}