I referred many examples of "Creating a SQL Type Corresponding to a PL/SQL Nested Table" such as
CREATE TYPE CourseList AS TABLE OF VARCHAR2(64);
CREATE TABLE department (
name VARCHAR2(20),
director VARCHAR2(20),
office VARCHAR2(20),
courses CourseList)
NESTED TABLE courses STORE AS courses_tab;
I referred many materials regarding this but I am not getting what is purpose of storing courses into courses_tab. Where will this courses_tab use? Please help me.
Nested tables are single-dimensional, unbounded collections of homogeneous elements. First, a nested table is single-dimensional, meaning that each row has a single column of data like a one-dimension array. Second, a nested table is unbounded. It means that the number of elements of a nested table is predetermined.
nesting table in American English. noun. one of a set of usually three or four small tables that are graduated in size so that they may be stacked on top of one another. Also called: stack table.
Within the database, nested tables can be considered one-column database tables. Oracle stores the rows of a nested table in no particular order. But, when you retrieve the nested table into a PL/SQL variable, the rows are given consecutive subscripts starting at 1. That gives you array-like access to individual rows.
Q 7 - Which of the following is true about PL/SQL nested tables? A - Nested tables are like one-dimensional arrays with arbitrary number of elements.
courses_tab
is used to name the physical table which stores the data for the nested table. You can find it by querying dba_nested_tables
. The column table_name
will have the value 'COURSES_TAB'
. In addition, you can get the structure of the table by issuing the command DESC COURSES_TAB
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With