Skip to content

Commit 773658f

Browse files
author
fabien.menager
committed
Fix drop table method
1 parent 5058480 commit 773658f

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

src/PhenX.EntityFrameworkCore.BulkInsert.Oracle/OracleBulkInsertProvider.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ protected override Task BulkInsert<T>(
7474
/// <inheritdoc />
7575
protected override async Task DropTempTableAsync(bool sync, DbContext dbContext, string tableName)
7676
{
77-
var connection = (OracleConnection)dbContext.Database.GetDbConnection();
78-
var commandText = $@"
79-
BEGIN
80-
EXECUTE IMMEDIATE 'DROP TABLE ' || :tableName;
81-
EXCEPTION
82-
WHEN OTHERS THEN
83-
IF SQLCODE != -942 THEN -- ORA-00942: table or view does not exist
84-
RAISE;
85-
END IF;
86-
END;";
87-
88-
await ExecuteAsync(sync, dbContext, commandText, new OracleParameter("tableName", tableName));
77+
var commandText = $"""
78+
BEGIN
79+
EXECUTE IMMEDIATE 'DROP TABLE {tableName}';
80+
EXCEPTION
81+
WHEN OTHERS THEN
82+
IF SQLCODE != -942 THEN -- ORA-00942: table or view does not exist
83+
RAISE;
84+
END IF;
85+
END;
86+
""";
87+
88+
await ExecuteAsync(sync, dbContext, commandText, CancellationToken.None);
8989
}
9090
}

0 commit comments

Comments
 (0)