MySQL rejection option

Well, I'm going crazy with that. MySQL throws a match for this SQL bit:

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

You have an error in the SQL syntax; check the manual that matches your MySQL server version for the correct syntax to use next to "COURSENAME") on line 1

My debugging code displays both parameter values.

+1
source share
2 answers

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

This, by the way, is consistent with ANSI SQL behavior. RDBMS, such as Oracle, support named parameters as an extension to the standard.

+2
source

, .

(?,?)

(: COURSEID,: COURSENAME)

0

All Articles