MySQL rejecting parameter

后端 未结 2 2006
误落风尘
误落风尘 2021-01-22 11:17

Ok, I\'m going crazy on this one. MySQL is throwing a fit about this bit of SQL:

INSERT INTO `test_table` 
  ( `column1`, `column2` ) 
VALUES 
  ( ?COURSEID, ?C         


        
相关标签:
2条回答
  • 2021-01-22 11:29

    MySQL does not support named parameter placeholders. You can use only positional parameter placeholders. That is, a placeholder is just a ? symbol.

    This conforms to the ANSI SQL behavior, by the way. RDBMS like Oracle support named parameters as an extension to the standard.

    0 讨论(0)
  • 2021-01-22 11:48

    Not sure if that will work. I would change to either

    VALUES (?, ?)

    OR

    VALUES (:COURSEID, :COURSENAME)

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