December 2010
Intermediate to advanced
451 pages
11h 16m
English
You need to store a group of numbers for later processing in another procedure.
Create an indexed table using an integer index to reference the elements. For example, this recipe loads values into an indexed table of numbers.
DECLARE
TYPE num_type IS TABLE OF number INDEX BY BINARY_INTEGER;
nums num_type;
total number;
BEGIN
nums(1) := 127.56;
nums(2) := 56.79;
nums(3) := 295.34;
-- call subroutine to process numbers;
-- total := total_table (nums);
END;
PL/SQL tables are indexed collections of data of the same type. The datatype can be any of the built-in datatypes provided by PL/SQL; in this example, the datatype is a number. Here are some ...
Read now
Unlock full access