Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / PL SQL Data Types
 

Variable

If the value1 is not NULL, then return it; otherwise return the value2. You can use expressions, variables, functions, and literals in NVL, as long as both variables are of the same datatype SQL> declare   2       v NUMBER;   3  begin   4       v:=nvl(v,0)+1;   5       DBMS_OUTPUT.put_line('New value: <'||v||'>');   6  end;   7  / New value: <1> PL/SQL procedure successfully completed. SQL>