I am having trouble with a sql query. I need to insert a row if the same row does not exist already. This is what I have so far:
DECLARE BEGIN FOR FOLDE
DECLARE N_COUNTS NUMBER; BEGIN select count(ID) into N_COUNTS from TABLE_NAME where ID = 1; IF N_COUNTS=0 THEN INSERT QUERY.... ELSE UPDATE QUERY.... END IF; END;