I need to run a SQL query that inserts some stuff in the table if the table has not a record with the name "Orders". So far I did this:
IF NOT EXISTS (
SELECT
*
FROM
gridconfigs
WHERE
gridconfigs.name = 'Orders'
)
INSERT INTO
`gridconfigs` (
`ownerId`,
`classId`,
`name`,
`searchType`,
`type`,
`config`,
`description`,
`creationDate`,
`modificationDate`,
`shareGlobally`
)
VALUES(
....
And this is the error I am getting:
Errore nella query (1064): Syntax error near 'INSERT INTO `gridconfigs` ( `ownerId`, `classId`, `name`, ...' at line 9
I do not get what the arror actually is.