Oracle Bulk Load takes the schema of the current connection, is there a way to prevent it from doing so? Just in case I can't create such a synonym, I just post. That is to say that when loading the bulk load it does not take any scheme.
public class BulkLoader
{
public static void LoadBulkData(string connectionString, DataTable data, string tableName)
{
ConnectionProvider provider = new ConnectionProvider(connectionString);
using (OracleConnection connection = provider.GetConnection())
{
OracleTransaction transaction = connection.BeginTransaction();
try
{
using (OracleBulkCopy bulkCopy = new OracleBulkCopy(connection))
{
bulkCopy.DestinationTableName = tableName;
foreach (DataColumn column in data.Columns)
{
bulkCopy.ColumnMappings.Add(column.ColumnName, column.ColumnName);
}
bulkCopy.WriteToServer(data);
}
transaction.Commit();
}
catch (Exception ex)
{
transaction.Rollback();
throw new Exception("Se produjo un error durante la carga masiva.", ex);
}
}
}
}
The indicated table is the correct one but it always takes the schema of the current connection something like Schema.Table and should be just Table
Check out the DestinationSchemaName to nominate the target schema.
https://docs.oracle.com/en/database/oracle/oracle-database/21/odpnt/OracleBulkCopyMembers.html#GUID-80BDCCC2-09DA-4F47-8A9B-28969B078749