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 Pass a Parameter to a Cursor
How To Pass a Parameter to a Cursor? - Oracle DBA FAQ - Working with Cursors in PL/SQL
✍: FYIcenter.com
When you define a cursor, you can set a formal parameter in the cursor. The formal parameter will be replaced by an actual parameter in the OPEN cursor statement. Here is a good example of a cursor with two parameters:
CREATE OR REPLACE PROCEDURE FYI_CENTER AS
CURSOR emp_cur(low NUMBER, high NUMBER)
IS SELECT * FROM employees WHERE salary >= low
AND salary <= high;
BEGIN
FOR row IN emp_cur(12000,15000) LOOP
DBMS_OUTPUT.PUT_LINE(row.first_name || ' '
|| row.last_name
|| ': ' || row.salary);
END LOOP;
END;
/
Nancy Greenberg: 12000
John Russell: 14000
Karen Partners: 13500
Alberto Errazuriz: 12000
Michael Hartstein: 13000
Shelley Higgins: 12000
2007-04-28, 5418👍, 0💬
Popular Posts:
.NET INTERVIEW QUESTIONS - What is Multi-tasking ? It’s a feature of modern operating systems with w...
How To Create an Add-to-My-Yahoo Button on Your Website? - RSS FAQs - Adding Your Feeds to RSS News ...
How can I include comments in HTML? An HTML comment begins with "<!--", ends with "-->...
How do you locate the first X in a string txt? A) txt.find('X'); B) txt.locate('X'); C) txt.indexOf(...
What is the difference between mysql_fetch_object() and mysql_fetch_array() functions in PHP? mysql_...