I’m using the Package Library Devart.Data.Oracle to connect to a Database. The connection itself works fine. After that, I’m using the OracleCommand to execute commands on the Database. Most of the time the commands are stored procedures, so I’m setting the commandtype to StoredProcedure. It looks like that.
Code: Select all
OracleCommand orCmd = new OracleCommand("Package.Procedure", databaseConnection);
orCmd.CommandType = System.Data.CommandType.StoredProcedure;
OracleCommandBuilder.DeriveParameters(orCmd);
…
But now a have to call a Procedure from an other databaseschema and use the same database connection. I found out, that it can be done using an @ to set the other schema. But if I’m using the same commands as before
Code: Select all
OracleCommand orCmd = new OracleCommand("Package.Procedure@NewSchema", databaseConnection);
orCmd.CommandType = System.Data.CommandType.StoredProcedure;
OracleCommandBuilder.DeriveParameters(orCmd);
…
I tried some different ways and found out that a select with a @schema an text as commandtype works.
Code: Select all
OracleCommand orCmd = new OracleCommand("Select * from table@Schema", databaseConnection);
orCmd.CommandType = System.Data.CommandType.Text;
orReader = orCmd.ExecuteReader();
…