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

Can we call procedure inside function in oracle?

606


Explain parameter file in oracle.

576


How can we find out the current date and time in oracle?

641


What is Segment Advisor in Oracle?

669


what is reindexing?

1177






What will be the syntax to find current date and time in format "yyyy-mm-dd"?

568


If youre unsure in which script a sys or system-owned object is created, but you know its in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?

1659


Point out the difference between user tables and data dictionary?

540


How to put more than 1000 values into an oracle in clause?

586


What is the difference between formal parameters and actual parameters?

543


How can we delete duplicate rows in a table?

564


How to grant create session privilege to a user in oracle?

570


State the difference along with examples between Oracle 9i, Oracle 10g and Oracle 11i.

605


What is oracle rowcount?

578


How to start an oracle instance?

574