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:
How To Retrieve Data from an Explicit Cursor
How To Retrieve Data from an Explicit Cursor? - Oracle DBA FAQ - Working with Cursors in PL/SQL
✍: FYIcenter.com
If you have a cursor opened ready to use, you can use the FETCH ... INTO statement to retrieve data from the cursor into variables. FETCH statement will:
Here is a sample script showing you how to use FETCH statement:
CREATE OR REPLACE PROCEDURE FYI_CENTER AS CURSOR t_list IS SELECT first_name, last_name FROM employees; f_name VARCHAR2(10); l_name VARCHAR2(10); BEGIN OPEN t_list; FETCH t_list INTO f_name, l_name; DBMS_OUTPUT.PUT_LINE('Name = ' || f_name || ' ' || l_name); FETCH t_list INTO f_name, l_name; DBMS_OUTPUT.PUT_LINE('Name = ' || f_name || ' ' || l_name); -- FETCH t_list INTO l_name; -- must have two variables CLOSE t_list; END; / Name = Ellen Abel Name = Sundar Ande
2007-04-29, 4546👍, 0💬
Popular Posts:
Can you explain what is “AutoPostBack” feature in ASP.NET ? If we want the control to automatically ...
How To Increment Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...
Can you explain in brief how the ASP.NET authentication process works? ASP.NET does not run by itsel...
Can JavaScript steal text from your clipboard? It is true, text you last copied for pasting (copy &a...
How do we create DCOM object in VB6? Using the CreateObject method you can create a DCOM object. You...