how table is defined in plsql table? how can i select
column from plsql table?
can i use select * from plsql table type?

Answer Posted / abapdeveloper09

1. Define a TABLE data type
TYPE type_name IS TABLE OF
(column_type | variable%TYPE
| table.column%TYPE | table%ROWTYPE
INDEX BY BINARY_INTEGER);

2 Declare a variable of that type
identifier type_name;

Assume the PLsql table (emp_table_type) has emp's first
name and index columns and you want to display this column
data (Emp's first name)

TYPE type_name IS TABLE OF
employee.firstname%TYPE
INDEX BY BINARY_INTEGER;

emp_table_type type_name;

Load data into emp_table_type table

-- Display emp's first name data
FOR index in EMP_table_type.FIRST..EMP_table_type.LAST
LOOP
DBMS_OUTPUT.PUT_LINE(EMP_table_type(index));
END LOOP;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

master table and child table performances and comparisons in Oracle ?

1662


Explain how you would restore a database using RMAN to Point in Time?

1631


How to define default values for formal parameters?

592


ABOUT IDENTITY?

1553


What is a server parameter file in oracle?

589






What do you mean by merge in oracle?

589


What are the different windows events activated at runtime ?

2408


How to best split csv strings in oracle 9i?

584


Name the three major set of files on disk that compose a database in Oracle?

631


Explain the use of Merge statement in oracle 11g

592


Point out the difference between user tables and data dictionary?

538


how to join query for one source type is oracle another source type is sql server ?

1987


What are the advantages of oracle 12c?

553


Explain a synonym?

600


What is system global area (sga) in oracle?

571