Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is pl/sql tables?

Answer Posted / bikash khuntia

Features of PL/SQL tables are as follows –

1) It is a composite data type.
2) They are modeled as similar to database tables, but they
are not permanent tables. So they can be created and
manipulated only in a PL SQL block.
3) They can have only one column but any data type
4) It will have a primary key which is compulsory for the
reference of values
5) There is no name to the column and primary key
6) The data type of the primary key is BINARY_INTEGER.
BINARY_INTEGER is a special data type which can be
given only to the column of PL/SQL table for it’s indexing
purpose to store and retrieve values.
Range of binary_integer is -2147483647 to 2147483647
7) Size is unconstrained (Table size grows as the rows are
added to the table).
8) Can visualize a Pl/SQL table as a single dimensional
vertical array, which can hold unlimited elements.
Suitable for storing and displaying the values of one
column of a table given by a cursor.


Example of PL SQL Table –

Each name from the emp table is given to the vname plsql
table by using cursor. Then those names from vname table
are displayed .

Declare
Type nametable IS TABLE OF CHAR(10) INDEX BY
BINARY_INTEGER;
/*Creating variable vname of nametable type.*/
vname nametable;
Cursor cf is select ename from emp;
i number;
/*i is for the loop and vrows is for displaying the
total names from the vname table*/
Begin
Open cf;
i := 1;
Loop
Fetch cf into vname(i);
/*Transferring each ename into vname table*/
Exit when cf%NotFound;
i := i+1;
End Loop;
Close cf;


/*Now retrieving the names from the vname plsql table using
for loop.*/
For n in 1 .. vname.count
Loop
dbms_output.put_line('Name is '||vname(n));
End Loop;
End;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is data stored on a disk?

964


how to drop an existing table in mysql? : Sql dba

987


Can you call pl/sql package functions from within a fast formula?

977


Whis is not false in primary key?

1406


What is clustered index in sql?

1003


What packages(if any) has oracle provided for use by developers?

5718


Can we insert data in view?

891


what is rollback? : Sql dba

1024


how to enter binary numbers in sql statements? : Sql dba

923


How is indexing done in search engines?

930


What is difference between nchar and nvarchar?

958


What is materialized view. What are different methods of refresh?

1332


what are date and time functions in mysql? : Sql dba

927


What is the difference among union, minus and intersect?

949


What is difference between pls_integer and integer?

910