How the cursor is used in the plsql block...... is it possible to do the same thing through queries in the block ( that what cursor do ) ..if it is so.., what is purpose of the cursor ???
Printable View
How the cursor is used in the plsql block...... is it possible to do the same thing through queries in the block ( that what cursor do ) ..if it is so.., what is purpose of the cursor ???
Hope this helps u regarding cursors in oracle pl/sql
CURSOR LIFE CYCLE
----------
declare-->open-->fetch-->check last record-->close
basic syntax of cursor
------------------------------
declare cursor cursorname [(param1,param2,....)] is select statment [for update [of col1,col2,..];
begin
open cursorname[(input arguments)];
loop
fetch cursorname into v1,v2,.....;
end loop;
close cursorname;
end;
hi
i think debasis had given the first question answer
for the second one
no its not possible to queries more than one row in pl/sql.
you have to name to work area for this work thru cursor
If u want to do manipulations to more than one row its compulsory to use cursors. without cursors we can't perform manipulations for more than one row.If u don't want to use a cursor then u have to write a query for each and every manipulation