English 中文(简体)
ORA-01036:
原标题:ORA-01036: illegal variable name/number, bind parameter between select and from
  • 时间:2019-07-22 03:03:18
  •  标签:
  • c#
  • odp.net

当我执行C#script,如灯塔时,请ORA-01036:非法变更姓名/编号

using (OracleConnection conn = new OracleConnection(connectionString))
using (OracleCommand cmd = conn.CreateCommand())
using (OracleDataAdapter da = new OracleDataAdapter())
using (DataTable dt = new DataTable())
{
  cmd.BindByName = true;   
  cmd.CommandText = "SELECT :A A FROM DUAL";
  cmd.Parameters.Add("A", "THE DATA");
  da.SelectCommand = cmd;    
  da.Fill(dt);
}

but when I change cmd.CommandText = "SELECT :A A FROM DUAL"; to cmd.CommandText = "SELECT A A FROM DUAL where :A = THE DATA "; it s run

我的问题是:bind params between select and from,t bebro by C#?

SOLUTION : I ve changed the library from Oracle.DataAccess to Oracle.ManagedDataAccess

问题回答

我更换了Oracle。 向Oracle提供数据图书馆

无效特性为:,因为在选定发言中不能予以承认,因此其行文如下:

cmd.CommandText = "SELECT A FROM DUAL WHERE A = @A";
cmd.Parameters.Add("@A", "THE DATA");

甲型六氯环己烷 A from

为了回答你的问题,错误来自Kall query,而不是C#。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签