Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Function Procedure Packages
 

Defining Formal Parameters

A parameter is a value that you can pass from a block of statements to a function. The Syntax for Defining a Parameter parameter_name [MODE] parameter_type [:= value | DEFAULT value] parameter_name is the name you assign to the parameter parameter_type is the variable type you assign. The optional MODE statement gives you complete control over your incoming parameters. The simplest parameter can be coded as (p_squared NUMBER) p_squared is the parameter_name, and NUMBER is the parameter_type. You can add a %TYPE after the parameter. %TYPE will pick up the field type from the table. (p_emptype employee.pay_type%TYPE) Types of modes. MODEHandling of Parameter INRead-only OUTWrite-only IN OUTRead or write