Referencing PL/SQL Table.

0
Referencing PL/SQL Table:
  • PL/SQL_Tablename(Primary_key_value);
  • PRIMARY_KEY_VALUE belongs to type BINARY_INTEGER.
  • The primary key value can be negative indexing need not start with 1.
  • The method make PL/SQL table easier to use are.
COUNT:
  • Returns the number of elements that a PL/SQL table currently contais.
SQL>DECLARE
                    TYPE name IS TABLE OF
                    VARCHAR2(50) INDEX BY BINARY_INTEGER;
                    n name;
          BEGIN
                    n(0):=’Siva’;
                    n(1):=’Rama’;
                    n(2):=’Krishna’;
                    display(‘The full name is ‘||n(0)||’ ‘||n(1)||’ ‘||n(2));
          END;
Note: In oracle 11g Negative index are not allowed.
                    Trace table:
                    ename varchar2(20),
                    usal number(7,2),
                    dou timestamp

About the author

Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus. Aenean fermentum, eget tincidunt.

0 comments:

Recent Posts