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



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

Answer / 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

More Oracle General Interview Questions

Can we commit inside a function in oracle?

0 Answers  


22. Display the order number, number of lines in the order, total number of items and total value for all orders that have a total value greater than $100

0 Answers   Wipro,


How to convert times to characters in oracle?

0 Answers  


You have one employee table having 3 entries emp_id, Mgr_id and salary. Mgr_id is also referencing emp_id. so now find out the emp_id which are having the second highest salary, under a particular manager.

3 Answers   Amazon, HCL,


What is primefaces used for?

0 Answers  


what is dynamic SGA and static SGA

0 Answers   Oracle,


Hi, I want table structure shown below. How can i create this ? Num Name Address Addr1 Addr2 I want Addr1 and Addr2 under Address column. How can i achive this ? Is it possible ?

2 Answers   IBM,


How do I learn what codesets are available in oracle?

0 Answers  


What is self-referential integrity constraint ?

2 Answers   SunGard,


How to establish administrator authentication to the server?

0 Answers  


How to start your 10g xe server from command line?

0 Answers  


What are the database administrators utilities available?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1808)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)