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

What is translate in oracle?

801


How do I use unicode codesets with the weblogic jdriver for oracle driver?

753


What is blob data type in oracle?

808


Explain what are the type of synonyms?

811


what is reindexing?

1338


How to view existing locks on the database?

762


How to create a new view in oracle?

821


What is the fastest query method to fetch data from the table?

1077


Explain the use of compress option in exp command.

726


How different is ms access and oracle?

754


How to use attributes of the implicit cursor in oracle?

758


Does facebook use oracle?

781


Is there a function to split a string in plsql?

764


What is merge statement used for?

749


What are the uses of a database trigger?

685