What does the following Oracle error mean: invalid column index

后端 未结 8 995
你的背包
你的背包 2020-12-17 08:09

I got the following error while testing some code:

SQLException: Invalid column index

What exactly does that mean?

Is

相关标签:
8条回答
  • 2020-12-17 08:34

    It sounds like you're trying to SELECT a column that doesn't exist.

    Perhaps you're trying to ORDER BY a column that doesn't exist?

    Any typos in your SQL statement?

    0 讨论(0)
  • 2020-12-17 08:35

    I also got this type error, problem is wrong usage of parameters to statement like, Let's say you have a query like this

    SELECT * FROM EMPLOYE E WHERE E.ID = ?
    

    and for the preparedStatement object (JDBC) if you set the parameters like

    preparedStatement.setXXX(1,value);
    preparedStatement.setXXX(2,value)
    

    then it results in SQLException: Invalid column index

    So, I removed that second parameter setting to prepared statement then problem solved

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