Easy learning with example program codes

How to execute a function in plsql?

Pl sql function:

The pl sql function is a named PL/SQL block which performs one or more specific tasks and must returns a value.

create or replace function getMultiple(num1 in number, num2 in number)    
return number    
  num3 number(8);    
  num3 :=num1*num2;    
  return num3;    

A functions return value can be assign to a variable.
result := getMultiple(4, 5);
As a part of a SELECT statement:
SELECT getMultiple(4, 5) FROM dual;
In a PL/SQL Statement:
dbms_output.put_line(getMultiple(4, 5));

See more at: Plsql function.

Related topics

Please follow and like us:

Copyright © 2019 CodesJava Protection Status SiteMap Reference: Java Wiki