Call function in dbms_output.put_line : Function Call « Stored Procedure Function « Oracle PL / SQL






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

1.Call function and store the return value to a variable
2.Use a user-defined function in stored procedure
3.Local Subprograms
4.Calling a Function
5.This function cannot be called from a SQL statement: cannot perform a DML operation inside a query
6.This function can be called from a SQL statement.
7.Function with insert statement can be called from a DML statement.