ORA-01008: not all variables bound. They are bound

前端 未结 8 1393
青春惊慌失措
青春惊慌失措 2020-11-29 08:01

I have come across an Oracle problem for which I have so far been unable to find the cause. The query below works in Oracle SQL developer, but when running in .NET it throws

相关标签:
8条回答
  • 2020-11-29 08:49

    I'd a similar problem in a legacy application, but de "--" was string parameter.

    Ex.:

    Dim cmd As New OracleCommand("INSERT INTO USER (name, address, photo) VALUES ('User1', '--', :photo)", oracleConnection)
    Dim fs As IO.FileStream = New IO.FileStream("c:\img.jpg", IO.FileMode.Open)
    Dim br As New IO.BinaryReader(fs)
    cmd.Parameters.Add(New OracleParameter("photo", OracleDbType.Blob)).Value = br.ReadBytes(fs.Length)
    cmd.ExecuteNonQuery() 'here throws ORA-01008
    

    Changing address parameter value '--' to '00' or other thing, works.

    0 讨论(0)
  • 2020-11-29 08:50

    It's a bug in Managed ODP.net - 'Bug 21113901 : MANAGED ODP.NET RAISE ORA-1008 USING SINGLE QUOTED CONST + BIND VAR IN SELECT' fixed in patch 23530387 superseded by patch 24591642

    0 讨论(0)
提交回复
热议问题