Find jobs | Jobseekers
Employer login
About us Sitemap of www.CareerRide.com Sitemap FAQ related with www.CareerRide.com FAQ Click here to Contact us Contact
       
Submit Resume Free ! | Access Resume Free !
Home Career Services Resume Services Interview questions Articles Books
Content
Oracle interview
Oracle architecture
Oracle processes
Oracle memory area
Oracle file types
Oracle database objects
Oracle operators
Oracle composite
Oracle constraints
Oracle data types
Oracle DCL and TCL
Oracle DML commands
Oracle error handling
Oracle functions
Oracle function, procedure, package
Oracle import and export
Oracle sub queries
Oracle table
Oracle triggers
Oracle views
Oracle synonym
Oracle indexes
Oracle joins
Oracle cursors
Oracle form
Oracle security
Oracle system privilege
Oracle object privileges
Oracle table privileges
Oracle view privileges
Oracle backup & recovery
Oracle DBA
Oracle PL/SQL
Oracle nested table & varrays
Oracle large objects
Oracle replication
Oracle transaction
Oracle optimizer
Oracle auditing
Oracle backup
Oracle database tuning
Oracle application tuning
Oracle procedures
Oracle functions
Oracle loops
Oracle exceptions
Oracle Select into clause
Oracle string functions
Oracle numeric functions
Oracle date functions
Oracle translate and decode
Oracle correlated sub-queries
Oracle union, intersect and minus
Oracle clusters
Oracle sequences
Oracle tablespaces
Oracle object datatypes
 
ASP.NET | ADO.NET | AJAX
C#.NET | VB.NET | PHP
NET Remoting | NET Interview
  
C | C++ | Java | Oops
Data Structure | OS
   
Database concepts | Oracle
SQL Server | Biztalk | Sharepoint
Notification services
Reporting Services
Service-oriented architecture
Data warehousing | MySQL
  
Project Management 
Linux | Testing | Networking
Software engineering 
  
UML | XML | HTML | SOAP 
CSS | VBScript  | Web Services
   
CV Cover letter | Interview 
HR | Soft skills | GD 
Working from Home 
Tutorial
ASP.NET | VB.NET | C#.NET     
Remoting.NET | Web service
Remoting overview | ADO.NET
UML | Sql server 
More links
Introduction to Legacy Modernization 
Oracle Web RowSet 
Books on Oracle
Oracle Modernization Solutions 
JDBC 4.0 and Oracle JDeveloper for J2EE Development 

Oracle

Oracle cursors interview questions

<<Previous  Next>>

Part 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30  | 31   NEXT>>  

Oracle cursors - August 11, 2008 at 15:00 PM by Amit Satpute

What a SELECT FOR UPDATE cursor represent?       

Answer
The result of a PREPARE statement is a statement identifier. It is a data structure that represents the prepared statement text.

To declare a cursor for the statement text, we associate a cursor with the statement identifier.

You can associate a sequential cursor with any prepared SELECT or EXECUTE FUNCTION (or EXECUTE PROCEDURE) statement.

You cannot associate a scroll cursor with a prepared INSERT statement or with a SELECT statement that was prepared to include a FOR UPDATE clause.

The SELECT FOR UPDATE clause in the cursor declaration is a convenient way of modifying the rows that have been retrieved by the cursor.

What WHERE CURRENT OF clause does in a cursor?       

Answer
PL/SQL provides the WHERE CURRENT OF clause for both UPDATE and DELETE statements inside a cursor.This allows you to easily make changes to the most recently fetched row of data. 

Syntax:

UPDATE table_name
    SET set_clause
WHERE CURRENT OF cursor_name; 

Notice that the WHERE CURRENT OF clause references the cursor and not the record into which the next fetched row is deposited.

Can you pass a parameter to a cursor?        

Answer
PL/SQL also allows you to pass parameters into cursors. It eases your work because:

- A parameter makes the cursor more reusable.
- A parameter avoids scoping problems.

However, you should pass parameters when you are goint to use it at more then one place and when there are hoing to be different values for the same WHERE statement.

Oracle cursors - August 28, 2008 at 17:00 PM by Amit Satpute

Explain the functioning of CURSOR FOR LOOP with example. 

Answer
Lets have a look at what Cursors are before going to the Cursor FOR loop.

A Cursor is a PL/SQL construct and accesses the stored information in a named work area.

There are 2 types of cursors:
Implicit: queries that return only one row
Explicit: can be declared by us for the queries that return more than one row.

e.g.
DECLARE
    CURSOR cursor_1 IS
         SELECT roll_no, student_name FROM student WHERE grade = 4;

A PL/SQL program opens a cursor, processes rows returned by a query, then closes the cursor.

This can be done with the help of:
     OPEN, FETCH, and CLOSE statements

Cursor FOR Loops
Instead of using OPEN, FETCH, and CLOSE statements, coding can be simplified by using FOR loops.

A cursor FOR loop opens a cursor, repeatedly fetches rows of values from the result set into fields in the record, then closes the cursor when all rows have been processed.

In the example below, the cursor FOR loop implicitly declares stud_record as a record:

DECLARE
CURSOR cursor_1 IS
SELECT student_name, birthdate FROM student;
...
BEGIN
FOR stud_record IN cuesor_1 LOOP
...
...
END LOOP;

Define Simple/Explicit , Parametric and Internal/Implicit cursor.

Answer
A Cursor is a PL/SQL construct and accesses the stored information in a named work area.

There are 2 types of cursors:
Implicit: queries that return only one row
Explicit: can be declared by us for the queries that return more than one row.


<<Previous  Next>>
The answers to following questions will be made available soon. Keep visiting.

Define cursor in oracle.
Describe the PL/SQL cursor attributes.
What are the steps required to be followed to use cursor.
Explain with an example how to pass parameters to PL/SQL cursors.
Explain the purpose of Cursor For Update with an example.
What are PL/SQL ref cursors?
Explain the PL/SQL collection, i.e. PL/SQL tables, nested tables, varrays.
Explain the PL/SQL collection methods, i.e. count, first, last, limit, prior, next, delete and trim, exist and extend.



 
Today's Hot Jobs
C++  SQL Server
.NET  Java  Oracle
Finance  Marketing
Seekers  Employers
Copyright © 2008 CareerRide.com. All rights reserved.