Please find by below code snippet :
BEGIN
IF (in_config1 IS NOT NULL OR in_config1 !='') THEN
UPDATE question_table
SET comment = in_config1
WHERE id= id
AND questionid = 1;
ELSE
INSERT INTO question_table(
tid
,questionid
,comments)
VALUES( id
, 1
, in_config1);
END IF;
END;
My requirement is to update question_table based on some condition.If update fails which would be incase if record is not present,then i need to add insert statement in the else block. In the above code update is working. But insert statement is not getting executed.Please let me know whats wrong?