我在我的oracle(11g)数据库中创建了两个表,如下所示:
create table "test" ("id" int);
create table test ("id" int);
Run Code Online (Sandbox Code Playgroud)
然后在我的C#程序中出现了一个问题:
OracleConnection conn = new OracleConnection(-myConnectionString-);
conn.Open();
OracleCommand command = new OracleCommand("select * from test;", conn);
var v = command.ExecuteReader();
OracleCommand command = new OracleCommand("select * from \"test\";", conn);
var v = command.ExecuteReader();
Run Code Online (Sandbox Code Playgroud)
对于command.ExecuteReader()我有一个"ORA-00911:无效字符"错误.
如何将Dapper与返回游标的Oracle存储过程一起使用?
var p = new DynamicParameters();
p.Add("foo", "bar");
p.Add("baz_cursor", dbType: DbType.? , direction: ParameterDirection.Output);
Run Code Online (Sandbox Code Playgroud)
这里,DbType是System.Data.DbType,它没有Cursor成员.我尝试过使用DbType.Object,但这对OracleClient和OracleDataAcess都不起作用.
相反,使用OracleType或OracleDbType的可能方法是什么?
我正在使用visual studio 2013和oracle数据库.我想在单个oraclecommand中同时执行多个创建表查询是否可能?我正在尝试跟随但不工作
OracleCommand cmd = new OracleCommand();
cmd.Connection = con;
cmd.CommandText = "create table test(name varchar2(50) not null)"+"create table test2(name varchar2(50) not null)";
//+ "create table test3(name varchar2(50) not null)"+"create table test3(name varchar2(50) not null)";
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
Run Code Online (Sandbox Code Playgroud)
cmd.ExecuteNonQuery();出错