locked
OracleBulkCopy : table or view does not exist RRS feed

  • Question

  • User-1685971342 posted

    Hi All,

    The summary of this discussion is, while using OracleBulkCopy, even after providing the correct table name and schema name, I get Table or View does not exist error. Below is my code :

    public static void WriteToServer(string qualifiedDBName, DataTable dataTable, string schemaName)
            {
                try
                {
                    using (OracleConnection con = new OracleConnection())
                    {
                        con.ConnectionString = Common.ConnectionString;
                        con.Open();
                        using (OracleBulkCopy bulkCopy = new OracleBulkCopy(con))
                        {
                            bulkCopy.DestinationTableName = schemaName + "." + qualifiedDBName;
                            bulkCopy.WriteToServer(dataTable);
                        }
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }

    Surprisingly, this code works in my developement environment, but does not work in UAT. in UAT, if I try to run a query like select * from meri_owner.ati_mapping, where meri_owner is the schema name and ati_mapping is the table name, it works properly.

    But when I use the same parameters in WriteToServer function(written above), it's not working. Please help, it's urgent.

    Friday, November 16, 2012 6:06 AM

All replies

  • User-1685971342 posted

    Well after all the searching and getting some help from colleagues, I finally found out the issue. My UAT site was using a user name which did not have insert/update access to the mentioned table. And the table is in another schema, so I had to create a synonym in the DB user for the schema.table and then use that for updating the value.

    Tuesday, November 20, 2012 1:39 AM