Actual Parameters vs Formal Parameters

By Manish Sharma

What are actual and formal parameters in programming?

The terms Actual parameters and Formal Parameters are not new to the programming world. If you have ever studied a programming language like Java and Dot Net then you must have come across these terminologies. While doing the PL/SQL Functions and Stored procedure series these were used very widely in my PL/SQL tutorials and thus I have been often asked to explain the difference between them.

This PL/SQL blog will explain to you what are actual and formal parameters. Also it will list the differences between them.

What are actual and formal parameters

What are Formal Parameters?

Formal parameter is the parameter which you specify when you define the subroutine or function. These parameters define the list of possible variables, their positions along with their datatypes. While specifying the formal parameters in the signature of your subroutines you do not assign any value to them except the default values which make a parameter optional.

Example of Formal Parameters

This is the header of the PL/SQL Function which we saw in How to Create Functions in Oracle Database. Here the parameter radius NUMBER is the formal parameter.

public static int Circle_area (int radius) { }
And that is the same function signature in Java where also the parameter int radius is a formal parameter.

What are actual parameters?

Actual parameters are the parameters which you specify when you call the subroutine such as Functions or Procedures. These are actually the values you provide to the subroutine when you call them. You can call a subroutine without an actual parameter when the formal parameter has a default value.

Example of Actual Parameters

  DBMS_OUTPUT.PUT_LINE(circle_area (25));
Here in the above PL/SQL anonymous block we call the function circle_area( ) whose signature we saw above by passing the value 25 against the formal parameter radius NUMBER. This Numeric value 25 is the actual parameter.

Always make sure that the datatype of the value you specified as an actual parameter must match with the datatype of the corresponding formal parameter. Also the value specified as an actual parameter of a function will override the default value of the corresponding formal parameter, if it has any.

That’s it about Formal and Actual Parameters. Do share this blog with your friends & help me spread the knowledge. Thanks & have a great day!

SQL Script and Presentation used

You can DOWNLOAD SQL script and presentation used in the Video and in this article.

SQL Script used in Video and in this article

I have used copy cloud to share these resourses. You can also join copy cloud and get 15GB free cloud storage for lifetime. If you will use this referal link You will get 5GB extra free cloud storage means total 20GB free cloud storage.

  • Manish Sharma Oracle Rebellion Rider
  • Manish Sharma Oracle certified SQL expert
  • Manish Sharma oracle certified associate
  • Manish Sharma oracle certified professional
  • View Manish Sharma's profile on LinkedIn

         View Manish Sharma's profile on LinkedIn