#techviewteam #plsql
In this video we discuss about oracle PL/SQL EXPLICIT CURSOR with practical example .
This is 11th video from series of videos about PL/SQL. so, you are requested to watch complete playlist for better understanding.
-------------------Video Notes start from here----------------------------
Explicit Cursors:-
Explicit cursors are programmer-defined cursors for
gaining more control over the context area
CURSOR cursor_name IS select_statement;
steps:-
Declaring the Cursor
CURSOR c_customers IS
SELECT id, name, address FROM customers;
Opening the Cursor
OPEN c_customers;
Fetching the Cursor
FETCH c_customers INTO c_id, c_name, c_addr;
CLOSE c_customers;
--------------
DECLARE
c_id varchar2(20);
c_name varchar2(200);
c_address varchar2(400);
CURSOR c_customers is
SELECT customer_id, name, address FROM customers where
rownum--10;
BEGIN
OPEN c_customers;
LOOP
FETCH c_customers into c_id, c_name, c_address;
EXIT WHEN c_customers%notfound;
dbms_output.put_line(c_id || ' ' || c_name || ' ' || c_address);
END LOOP;
--CLOSE c_customers;
END;
/
---------------------
Regards
TechView Team