クエリは次のようになります。
string query = "IF NOT EXISTS(
SELECT * from clienti
where CodCliente= ' " + id + " '
AND NomeCliente= ' " + emri + " '
AND RagioneSociale=' " + ragSoc + " '
AND PartitaIVA=' " + piva + " ')
Insert INTO clienti VALUES(
' " + id +
" ',' " + emri +
" ',' " + ragSoc +
" ',' " + piva + " ')
else
UPDATE clienti
SET(' " + id + " ',' " + emri + " ',' " + ragSoc + " ',' " + piva + " ')";
以下に示す同じ問題が発生し続けます。
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NOT EXISTS(SELECT * from clienti where CodCliente= ' 1 ' AND NomeCliente= ' ' at line 1