Gebruik een bestaanscontrole via information_schema:
IF (SELECT COUNT(*) FROM information_schema.tables
WHERE table_schema = 'databasename'
AND table_name = 'tablename') > 0 THEN
INSERT ...
END IFDeze aanpak controleert of de tabel bestaat voordat je schrijft.