Call function in dbms_output.put_line
SQL>
SQL>
SQL> create or replace function ite(
2 p_expression boolean,
3 p_true varchar2,
4 p_false varchar2 ) return varchar2 as
5 begin
6 if p_expression then
7 return p_true;
8 end if;
9 return p_false;
10 end ite;
11 /
Function created.
SQL>
SQL>
SQL> exec dbms_output.put_line( ite( 1=2, 'Equal', 'Not Equal' ) );
Not Equal
PL/SQL procedure successfully completed.
SQL>
SQL> exec dbms_output.put_line( ite( 2>3, 'True', 'False' ) );
False
PL/SQL procedure successfully completed.
SQL>
Related examples in the same category