January 2012
Intermediate to advanced
542 pages
11h 28m
English
In programming languages, we can pass parameters by reference and by value to a function. In this recipe, we will see how to make out this difference in PL/SQL functions and procedures.
The following steps will demonstrate passing parameters to functions:
SH schema:
CONNECT sh@TESTDB/sh
TAB_NUMBERS, which is a table of numbers:
CREATE OR REPLACE TYPE sh.TAB_NUMBERS AS TABLE OF NUMBER;
MY_VALUE, which returns an element of an array:CREATE OR REPLACE FUNCTION MY_VALUE(ATABLE IN OUT TAB_NUMBERS, AIND IN NUMBER) RETURN NUMBER IS L_VALUE NUMBER := 0; BEGIN L_VALUE := ATABLE(AIND); RETURN L_VALUE; END; /
MY_VALUE_NOCOPYRead now
Unlock full access