I am trying to insert some data into a table, but only if the table is empty. So this is what i tried.
IF EXISTS (select * from ${schema}.JITenant) THEN ELSE <inster_statements> END IF;
Error log shows:
SQL State : 42601
Error Code : 0
Message : ERROR: syntax error at or near "IF"
Position : 1
Line : 7
Statement : IF EXISTS (select * from migrate.JITenant) THEN
ELSE
INSERT into migrate.JITenant
I cant figure out what the problem is.
Aucun commentaire:
Enregistrer un commentaire