Why am I getting an ORA-01722 (invalid number)?

前端 未结 3 1808
花落未央
花落未央 2021-02-14 21:28

I\'ve been using a parameterized query to insert values into an Oracle table, like so:

var q = \"insert into MyTable(Field1, Field2...) values(:Field1, :Field2..         


        
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-14 21:55

    I have given answer credit already, but I think it's worth mentioning here exactly what the root of my problems was, in case anyone else finds this item while looking for an answer to their own problem.

    The problem is that the C# implementation of parameterized queries for Oracle contains a serious and potentially dangerous bug - a real "pit in the public domain":

    It doesn't matter what you name your parameters; they have to be added in the order in which they appear in the query.

    See more here.

提交回复
热议问题