Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Can cursor variables be stored in PL/SQL tables. If answer is yes, explain how? If not why?
Can cursor variables be stored in PL/SQL tables. If answer is yes, explain how? If not why?
✍: Guest
Yes. Create a cursor type - REF CURSOR and declare a cursor variable of that type.
DECLARE
/* Create the cursor type. */
TYPE company_curtype IS REF CURSOR RETURN company%ROWTYPE;
/* Declare a cursor variable of that type. */
company_curvar company_curtype;
/* Declare a record with same structure as cursor variable. */
company_rec company%ROWTYPE;
BEGIN
/* Open the cursor variable, associating with it a SQL statement. */
OPEN company_curvar FOR SELECT * FROM company;
/* Fetch from the cursor variable. */
FETCH company_curvar INTO company_rec;
/* Close the cursor object associated with variable. */
CLOSE company_curvar;
END;
2011-10-25, 2719👍, 0💬
Popular Posts:
Which one of the following statements is TRUE in regard to overloading the ++ operator? 1 You cannot...
How can I include comments in HTML? An HTML comment begins with "<!--", ends with "-->...
What is CodeDom? “CodeDom” is an object model which represents actually a source code. It is designe...
How can we implement singleton pattern in .NET? Singleton pattern mainly focuses on having one and o...
What is page thrashing? Some operating systems (such as UNIX or Windows in enhanced mode) use virtua...