What is a cursor for loop ?
Answers were Sorted based on User's Feedback
Answer / anil kumar jampana
cursor for loop is also a cursor. Here no need to handle
open,fetch,close operations. These operations are handled
by for loop.
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / dipti
Another nice feature of the CURSOR FOR is the ability to
define the cursor inline. Below is a cursor that is not
declared in the declaration section of the executing
block. The cursor definition is included in the CURSOR FOR.
SQL> begin
2 for r_c11 in
(select author_last_name l_name,
3 author_first_name f_name
4 from author) loop
5 dbms_output.put_line(initcap(
6 r_c11.l_name||
', '||r_c11.f_name));
7 end loop;
8 end;
9
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / nishi
cursor for loop is also a cursor. Here no need to handle open, fetch, close operations. These operations are handled by for loop.
| Is This Answer Correct ? | 0 Yes | 0 No |
Cursor for loop implicitly declares %rowtype as Loop index
opens the cursor and fetch the rows from active set into
fields and then process it and then close the cursor.
| Is This Answer Correct ? | 1 Yes | 3 No |
How to find last day of the month in sql query
What is the use of index in sql?
what is normalization? : Sql dba
What is pl/sql table? Why is it used?
What is nvarchar in sql?
What are the parameter modes supported by pl/sql?
What is the difference between null value, zero, and blank space?
What is difference between left and right outer join?
how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba
Source is Sales Table: Sno Prod Sales Sales_Amount 1 A 10 2000 2 A 20 1000 3 C 10 3000 4 D 30 4000 5 A 20 1000 Target : Sales_Count T_Sales_Amt Sales_Count(A) T_Sales_Amt(A) 90 11000 50 4000 In single query, pls tell me.
What is tuple in sql?
What is cursor and why it is required?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)