I'm trying to insert a record into the table, but this record will only be inserted if it does not already exist there, so I'm trying to do it like this:
INSERT INTO R01 (NUMERO,EXPORTADOR, IMPORTADOR, DATAANTECIPADO, STATUS)
VALUES
(64, 'CCB TESTE LTDA.', 'CCB TESTE LTDA.', (select cast('Now' as date) from rdb$database), 'A')
WHERE NOT EXISTS ( SELECT * FROM R01 WHERE NUMERO=64 ,SERIE='CTE' );
The error message is this:
Dynamic SQL Error. SQL error code = -104. Token unknown - line 4, char 1. WHERE.