GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 41 of 171    Print  
Can cursor variables be stored in PL/SQL tables.If yes how. If not why?
No, a cursor variable points a row which cannot be stored in a two-dimensional PL/SQL table.



  
Total Answers and Comments: 1 Last Update: December 12, 2006   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: rampratap409
 

No you can not store the cursor variable into pl/sql table

but yes the out put or cursor variable can be stored how:

set serveroutput on

declare
type v_table is table of emp%rowtype index by binary_integer;
my_table v_table;
i number;
cursor c1 is select * from emp;
begin
i := 1;
open c1;
loop
fetch c1 into my_table(i);
exit when c1%notfound;
i := i + 1;
end loop;
for r in 1.. my_table.count
loop
dbms_output.put_line(my_table(r).empno);
end loop;
end;



Above answer was rated as good by the following members:
rituk_15
December 12, 2006 09:29:18   #1  
rampratap409 Member Since: September 2006   Contribution: 111    

RE: Can cursor variables be stored in PL/SQL tables.If...

No you can not store the cursor variable into pl/sql table

but yes the out put or cursor variable can be stored how:

set serveroutput on

declare
type v_table is table of emp rowtype index by binary_integer;
my_table v_table;
i number;
cursor c1 is select * from emp;
begin
i : 1;
open c1;
loop
fetch c1 into my_table(i);
exit when c1 notfound;
i : i + 1;
end loop;
for r in 1.. my_table.count
loop
dbms_output.put_line(my_table(r).empno);
end loop;
end;


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

Self join-Its a join foreign key of a table references the same table. Outer Join--Its a join condition used where One can query all the rows of one of the tables in the join condition even though they 
Latest Answer : Please let me know various joins available and description for every joinRegards,sireesha ...

TABLESVIEWSINDEXESSYNONYMSSEQUENCESTABLESPACES etc 
Latest Answer : In Oracle DB Objects are   Table   View   Indexes   Sequences        Used to generate primary key values   Synonym           ...

A view is stored procedure based on one or more tables, it’s a virtual table. 
Latest Answer : View View is logical table based on one are more table join and named as viewname View is not stored in database View is used to perform complex query, View Object, View support, LOB, varray, Nested Tables Should have CREATE ...

Outer Join--Its a join condition used where you can query all the rows of one of the tables in the join condition even though they don’t satisfy the join condition. 
Latest Answer : outer join is that type of jon which retrives the matach & alson unmatached recores also from the tables ...

Oracle does not allow a user to specifically locate tables, since that is a part of the function of the RDBMS. However, for the purpose of increasing performance, oracle allows a developer to create a 
Latest Answer : Clustering is a method of storing tables that are intimately related and often joined together into the same area on disk. For example, instead of the BOOKSHELF table being in one section of the disk and the BOOKSHELF_AUTHOR table being somewhere else, ...

Oracle uses work area to execute SQL statements and store processing information PL/SQL construct called a cursor lets you name a work area and access its stored information A cursor is a mechanism used 
Latest Answer : Oracle ueses the private area for excute SQL statements and store processing information. The private area is called as CONTEXT AREACURSOR: cursor is a handle or pointer to the context area. ...

PL/SQL declares a cursor implicitly for all SQL data manipulation statements, including quries that return only one row. However,queries that return more than one row you must declare an explicit cursor 
Latest Answer : explicit ...

%ROWCOUNT%NOTFOUND%FOUND%ISOPEN 
Latest Answer : %ROWTYPE - returns number of the rows which are fetched/updated/deleted%ISOPEN    - returns true if the cursor is open%FOUND     - returns true if the cursor fetched any row%NOTFOUND-returns true if the cursor does ...

Cursor For Loop is a loop where oracle implicitly declares a loop variable, the loop index that of the same record type as the cursor's record. 
Latest Answer : The cursor FOR loop is a shortcut to process explicit cursors. Implicit open, fetch, exit, and close occur. The record is implicitly declared. ...

NO DATA FOUND is an exception raised only for the SELECT....INTO statements when the where clause of the querydoes not match any rows. When the where clause of the explicit cursor does not match any rows 
Latest Answer : NO DATA FOUND: Is an exception which is raised when no rows are retrieved from the database in a SELECT statement, then PL/SQL raises the exception NO_DATA_FOUND.%NOTFOUND: is a Boolean attribute that evaluates to TRUE if the most recent SQL statement ...


 Sponsored Links

 
Related Articles

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Using Oracle XML DB Repository

Using Oracle XML DB Repository Another variation on accessing and manipulating XML content stored in Oracle database is provided by Oracle XML DB repository which is an essential component of Oracle XML DB mosgoogle NOTE Oracle XML DB repository also known as XML repository is a hierarchically organ
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

XML Processing in PHP and Oracle Applications

Processing XML in PHP Oracle Applications As mentioned there are two alternatives when it comes to performing XML processing in your PHP Oracle application You can perform any required XML processing using either PHP s XML extensions or PEAR XML packages or Oracle s XML features mosgoogle In the fol
 

PHP Oracle Web Development

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax is a good starting b
 

ODP.NET - Working with Bind Variables together with OracleParameter

ODP NET Working with Bind Variables together with OracleParameter With the help of OracleParameter you can include bind variables within any SQL statement These bind variables are nothing but run time query parameters The values in the SQL statement are bound at run time when we use bind variables m
 

Getting Started with Oracle and ODP.NET

ODP NET Developer’ s Guide by Jagadish Chatarji Pulakhandam Sunitha Paruchuri A practical guide for developers working with the Oracle Data Provider for NET and the Oracle Developer Tools for Visual Studio 2005 Application development with ODP NET Dealing with XML DB using ODP NET Oracle
 

PHP Oracle Web Development Review

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books The author is also an expert in open source technologies and SOA Service Oriented Architecture But besides
 

Microsoft AJAX Library - Functions as Variables

Functions as Variables In JavaScript functions are first class objects This means that a function is regarded as a data type whose values can be saved in local variables passed as parameters and so on For example when defining a function you can assign it to a variable and then call the function thr
 

Step by Step Oracle PL-SQL Tutorial

This introductory tutorial to PL SQL will help you to understand the basic concepts of PL SQL Please review the following tutorials and practice the sample SQL Statements on your local Oracle Database Please note that you must learn these basic things before we actually start getting in to Advanced
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape