

, or sn) only before comparing it to the first argument (e), rather than evaluating all search. The DECODE function returns a value that is the same datatype as the first result in the list. It is possible to use DECODE, but you'd have to use nested DECODEs and you'd end up with something that's much harder to read, understand and therefore maintain. The DECODE() function evaluates each search value (s1, s2. select 1 value1,Ĭase when 'a' = 'a' and 'b' = 'b' then 'pass' It is used to work as an IF-THEN-ELSE statement. Anyway, decode works fine in my procedure. DECODE is an advanced function that the Oracle database supports. As far as I know, nothing prevents one from using a SQL function in a PL/SQL program. Oracle/PLSQL DECODE functionhas functionality of IF-THEN-ELSE operator. DECODE and CASE statements in Oracle both provide a conditional construct, of this form: if A n1 then A1 else if A n2 then A2 else X Everything DECODE can. The simplest answer is don't use decode, use a case statement instead, e.g. 1 DECODE is a SQL function, not a PL/SQL function.
