For SqlClient, I am able to specify CommandBehavior.SchemaOnly for a lot of queries to get the query result schema. However, when use the same command behavior for Oracle, OracleClient seems to execute the query instead of obtaining the schema only. In the following example, I can see the row was indeed inserted into my database while I was just expecting to run a schema only query:
OracleCommand command = connection.CreateCommand();
command.CommandText = "insert into Test (ID, Name) values (1, 'test')";
var reader = command.ExecuteReader(CommandBehavior.SchemaOnly);
var dataTable = reader.GetSchemaTable();
I cannot find much info on OracleClient doc about CommandBehavior. Does OracleClient implement this option? Or should I use a different way to get the schema without running the query?