All NZPLSQL IF statements require a corresponding END IF statement. In ELSE-IF statements, you need two END IF statements: one for the first IF and one for the second (ELSE IF).
IF v_user_id <> 0 THEN
UPDATE users SET email = v_email WHERE user_id = v_user_id;
END IF;
IF parentid IS NULL or parentid = ''
THEN
return fullname;
ELSE
return hp_true_filename(parentid) || '/' || fullname;
END IF;
IF v_count > 0 THEN
INSERT INTO users_count(count) VALUES(v_count);
return 't';
ELSE
return 'f';
END IF;
IF movies.genre = 'd' THEN
film_genre := 'drama';
ELSE
IF movies.genre = 'c' THEN
film_genre := 'comedy';
END IF;
END IF;
IF movies.genre = 'd' THEN
film_genre := 'drama';
ELSE IF movies.genre = 'c' THEN
film_genre := 'comedy';
END IF;
END IF;
IF movies.genre = 'd' THEN
film_genre := 'drama';
ELSIF movies.genre = 'c' THEN
film_genre := 'comedy';
ELSIF movies.genre = 'a' THEN
film_genre := 'action';
ELSIF movies.genre = 'n' THEN
film_genre := 'narrative';
ELSE
-- An uncategorized genre form has been requested.
film_genre := 'Uncategorized';
END IF;
The IF-THEN-ELSIF-ELSE form offers some flexibility and eases the coding process when you need to check many alternatives in one statement. While it is equivalent to nested IF-THEN-ELSE-IF-THEN commands, it needs only one END IF statement.