Skip to content

Fix Oracle bulk insert schema qualification issues#101

Merged
PhenX merged 2 commits into
PhenX:mainfrom
DPschichholz:bugfix/fix-oracle-schema
Jun 15, 2026
Merged

Fix Oracle bulk insert schema qualification issues#101
PhenX merged 2 commits into
PhenX:mainfrom
DPschichholz:bugfix/fix-oracle-schema

Conversation

@DPschichholz

Copy link
Copy Markdown
Contributor

Fix Oracle bulk insert ORA-39831 when EF Core default schema is configured

  • Fix double-schema qualification when EF Core default schema is configured
  • Clarify table name handling comment

Details

When HasDefaultSchema(...) is set, tableInfo.QuotedTableName becomes a SQL-quoted fully qualified identifier (e.g. "SchemaX"."TableA"). Passing this to OracleBulkCopy.DestinationTableName causes ODP.NET to double-apply the schema, producing SchemaX.SchemaX.TableA and failing with ORA-39831.

Change

  • OracleBulkInsertProvider.BulkInsert: compute destinationTableName before assigning to bulkCopy.DestinationTableName:
    • Direct insert path (tableName == tableInfo.QuotedTableName): use tableInfo.TableName (plain unquoted name — ODP.NET resolves the schema itself)
    • Temp table path: use tableName unchanged
var destinationTableName = tableName == tableInfo.QuotedTableName
    ? tableInfo.TableName
    : tableName;

bulkCopy.DestinationTableName = destinationTableName;

@DPschichholz DPschichholz changed the title Fix Oracle bulk insert schema qualification issues (#1) Fix Oracle bulk insert schema qualification issues May 20, 2026
@DPschichholz DPschichholz marked this pull request as ready for review May 20, 2026 13:06
@DPschichholz DPschichholz requested a review from PhenX as a code owner May 20, 2026 13:06
PhenX
PhenX previously approved these changes May 20, 2026

@PhenX PhenX left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok for me, but can you update your branch for the CI to pass ?

- Fix double-schema qualification when EF Core default schema is configured
- Clarify table name handling comment
@DPschichholz DPschichholz force-pushed the bugfix/fix-oracle-schema branch from a3743ef to ba1b5b4 Compare May 21, 2026 07:02
@DPschichholz

Copy link
Copy Markdown
Contributor Author

@PhenX The branch has been rebased

@PhenX

PhenX commented May 21, 2026

Copy link
Copy Markdown
Owner

@DPschichholz thanks, the test fails now, can you check it?

@DPschichholz DPschichholz marked this pull request as draft May 29, 2026 07:42
@DPschichholz DPschichholz marked this pull request as ready for review June 12, 2026 08:20
@DPschichholz DPschichholz requested a review from PhenX June 15, 2026 13:10
@PhenX PhenX merged commit 51cd4e1 into PhenX:main Jun 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants