Checking for NOT EQUAL TO (Strings) in PL/SQL
591586Aug 6 2007 — edited Aug 6 2007I am trying to compare two strings in an IF statement, for NOT EQUAL TO.
IF (string1 <> string 2) THEN
... do specific task
END IF;
But this didn't work (there is no doubt about it, I tested it thoroughly and noticed that it didn't work).
Then I changed it to = with an ELSE condition as below, and my 'do specific task' executed.
IF (string 1 = string2) THEN
SELECT 1 INTO temp FROM DUAL; --unnecessary statement
ELSE
... do specific task
END IF;
What is the correct way of checking for NOT EQUAL TO?