A stored function with no parameters. : Function Parameters « Stored Procedure Function « Oracle PL / SQL






A stored function with no parameters.

    
SQL>
SQL> set serveroutput on
SQL>
SQL> CREATE OR REPLACE PROCEDURE NoParamsP AS
  2  BEGIN
  3    DBMS_OUTPUT.PUT_LINE('No Paramaters!');
  4  END NoParamsP;
  5  /

Procedure created.

SQL>
SQL> CREATE OR REPLACE FUNCTION NoParamsF
  2    RETURN DATE AS
  3  BEGIN
  4    RETURN SYSDATE;
  5  END NoParamsF;
  6  /

Function created.

SQL>
SQL> BEGIN
  2    NoParamsP;
  3    DBMS_OUTPUT.PUT_LINE('Calling NoParamsF on ' || TO_CHAR(NoParamsF, 'DD-MON-YYYY'));
  4  END;
  5  /
No Paramaters!
Calling NoParamsF on 18-JUN-2008

PL/SQL procedure successfully completed.

SQL>

   
    
    
  








Related examples in the same category

1.Pass value to function parameter
2.Boolean value function parameter
3.The FullName Function
4.Use Column type as the function parameter type
5.Varray type parameter
6.Clob type parameter
7.Positional Notation
8.Get circle area
9.Named Notation
10.Pass number value to function
11.Mixed Name and Position Notation Calls