I'm writing a procedure in PL/SQL, where I need to check whether a given value does not equal x or y. I use the following code to check:
IF p_campaignPaymentType != 'per month' || 'per creation' THEN
RAISE ex_invalidPaymentType;
END IF;
Now, even if the string given in p_campaignPaymentType is 'per month' or 'per creation', it raises the exception ex_invalidPaymentType.
What is the problem with the IF-sentence, and/or what could I do to as an alternative for checking?
||is string concatenation operator, not logicalORoperator (even if it was it'd be used incorrectly anyway). UseORoperator.ORinstead of||resulted in the following error: Error(53,46):PLS-00382: expression is of wrong typeORoperator in the phrase "UseORoperator", it was a typo I meant to sayAND, of course. You need to place it between two logical conditions.