CodesJava

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    
is     
  num3 number(8);    
begin    
  num3 :=num1*num2;    
  return num3;    
end;    
/

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

Sign Up/ Sign In
Ask a Question


Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at hr@codesjava.com.

Development

We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on hr@codesjava.com.

Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki