CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Interview Success Kit - Get Success in Job Interviews Interview Success Kit - 30,000 Interview Que. & Ans.
Covers 30,000+ Interview Questions asked in actual MNC Interviews - all with model answers.

Sponsored Links

Interview Questions
Our Services

INTERVIEW QUESTIONS ORACLE PL-SQL DETAILS
Question :

State the advantage and disadvantage of Cursor?



Category PL-SQL Interview Questions
Rating (3.3) By 81 users
Added on 8/18/2011
Views 6883
Rate it!


Answers:

Source: CoolInterview.com

Advantage :

In pl/sql if you want perform some actions more than one records you should user these cursors only. bye using these cursors you process the query records. you can easily move the records and you can exit from procedure when you required by using cursor attributes.

disadvantage:

using implicit/explicit cursors are depended by sutiation. if the result set is les than 50 or 100 records it is better to go for implicit cursors. if the result set is large then you should use exlicit cursors. other wise it will put burdon on cpu.

Source: CoolInterview.com



Source: CoolInterview.com

Disadvantage:
Each time we fetch a row from the cursor, it result a network round trip, where as a normal select statement query make only one round trip.
Source: CoolInterview.com



Posted by: Praveen Jindal

Contact Praveen Jindal Contact Praveen Jindal

Source: CoolInterview.com

The guy's answer at the top of this page about "Cursors" is probably not wrong but sounds wrong and it is hard to understand, it sounds like he has tried to type the answer in english but it is shameful, his english is totally broken, it is bad. You guys at coolinterview.com should do something about such posting to keep up the readership.
Source: CoolInterview.com



Posted by: good programmer

Contact good programmer Contact good programmer

Source: CoolInterview.com

Advantage of cursor
1.Basically cursor is a logical place or it is active set.
when a single query returns more than one rows in that case we can use the cursor. we don't need hit the database several time. Cursor
always points the latest rows.

Disadvantage of cursor
1.As such there is no disadvantage
of cursor.

Source: CoolInterview.com



Posted by: sudipta das

Contact sudipta das Contact sudipta das

Source: CoolInterview.com

Advantages:
Cursors are somewhat like Pointers of Oracle, Oracle executes a query and assign some name to that memory location, which is known as Cursor.
Cursors are used for storing data temperarorily.
Cursors are used for storing, managing and retrieving data.
Cursors stores in the RAM so the data access and retrieval is fast.

Disadvantage:
No such disadvantage. Only thing is that rather than storing data in an intermediate variable and fetching it one by one via cursor and then processing it sequentially, we can use Collections. By using collections, we can pass the bundle of Data at once.
Source: CoolInterview.com



Posted by: Sachin Nagpal

Contact Sachin Nagpal Contact Sachin Nagpal

Source: CoolInterview.com

Cursors adv:
easier to retrieve a batch of records into the cursor and then perform manipulations on them before displaying the results.

Disadvantage:
The biggest disadvantage of cursors is that they eat up you RAM. If you're retrieving a large number of records into your cursor inside a procedure on an OLAP database, it will take a long long time to execute that procedure. The better alternative would be to retrieve directly from one or more table using selection criteria to eliminate records, and perform manipulation on each record on the fly.

Source: CoolInterview.com



Posted by: HarshDeep Singh

Contact HarshDeep Singh Contact HarshDeep Singh

Source: CoolInterview.com

cursor is nothing but it's a memory area of executing sql or oracle statements.
Advantage:
1. We can retrieve more than one record by one query.
2. It's use our RAM so retrieval is fast.
3. By using Collection we can retrieve the bundle of data in cursor.

Disadvantage:
No such of disadvantage of cursor. When we use cursor one thing is necessary. When I have select only 50 or 100 rows we should use implicit cursor and when more record then we should use Explicit cursor.
Source: CoolInterview.com



Posted by: Amit Singh

Contact Amit Singh Contact Amit Singh

Source: CoolInterview.com

Everything written above regarding cursor is right, apart from that i wan't to add few more points.

1) A cursor is a oracle variable.
2) It is similar to a 2D Array.
3) It is used for storing (temporarily) multiple records for processing and handling multiple records.
4) It is a forward only and read only variable type.

Disadvantage.

As such there is no disadvantage but if the table data in the cursor is huge then there may be performance issues.
Instead if possible use joins rather than cursors.
Source: CoolInterview.com



Posted by: Ashish Khudlani

Contact Ashish Khudlani Contact Ashish Khudlani

Source: CoolInterview.com

cursor is nothing but it's a memory area of executing sql or oracle statements.
Advantage:
1. We can retrieve more than one record by one query.
2. It's use our RAM so retrieval is fast.
3. By using Collection we can retrieve the bundle of data in cursor.

Disadvantage:
No such of disadvantage of cursor. When we use cursor one thing is necessary. When I have select only 50 or 100 rows we should use implicit cursor and when more record then we should use Explicit cursor.
Source: CoolInterview.com



Posted by: narendra

Contact narendra Contact narendra

Source: CoolInterview.com

advantage:
1.name this work area
2.access their stored information
3.process multiple records
disadvantage:
1.variable can be define declare section of pl/sql block
2.valid in pl/sql block only
Source: CoolInterview.com



Posted by: hanumantha reddy.d

Contact hanumantha reddy.d Contact hanumantha reddy.d

If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification Enter the above shown code: *
    Inform me about updated answers to this question

    Related Questions
    View Answer
    State the difference between implicit and explicit cursor's.

    View Answer
    What is difference between stored procedures and application procedures,stored function and application function?

    View Answer
    Explian rowid,rownum?What are the pseduocolumns we have?

    View Answer
    1)What is the starting "oracle error number"?
    2)What is meant by forward declaration in functions?

    View Answer
    In a Distributed Database System Can we execute two queries simultaneously ? Justify ?

    View Answer
    How we can create a table in PL/SQL block. insert records into it??? is it possible by some procedure or function?? please give example...

    View Answer
    How to avoid using cursors? What to use instead of cursor and in what cases to do so?

    View Answer
    How to disable multiple triggers of a table at at a time?

    View Answer
    Can we declare a column having number data type and its scale is larger than pricesion
    ex: column_name NUMBER(10,100),
    column_name NUMBAER(10,-84)

    View Answer
    What are the Restrictions on Cursor Variables?
    View Answer
    What will the Output for this Coding?
    Declare
    Cursor c1 is select * from emp FORUPDATE;
    Z c1%rowtype;
    Begin
    Open C1;
    Fetch c1 into Z;
    Commit;
    Fetch c1 in to Z;
    end;


    View Answer
    What is PL/SQL ?
    View Answer
    What is the basic structure of PL/SQL ?
    View Answer
    What are the components of a PL/SQL block ?
    View Answer
    What are the components of a PL/SQL Block ?
    View Answer
    What are the datatypes a available in PL/SQL ?
    View Answer
    What are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?
    View Answer
    What is difference between % ROWTYPE and TYPE RECORD ?
    View Answer
    What is PL/SQL table ?
    View Answer
    What is a cursor ? Why Cursor is required ?
    View Answer

    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL PL-SQL Interview Questions & Answers

    User Options
    India News Network

    Latest 20 Questions
    what is the maximum segment length of a 100Base-FX network?
    What is mesh topology?
    What is IPv6?
    What is one basic requirement for establishing VLANs?
    When it comes to networking, what are rights?
    What protocols fall under the TCP/IP Internet Layer?
    What is the role of IEEE in computer networking?
    What is sneakernet?
    Explain profile in terms of networking concept?
    What can be done to fix signal attenuation problems?
    What is one advantage of mesh topology?
    What do mean by tunnel mode?
    Explain the importance of authentication.
    How are IP addresses arranged and displayed?
    What is the importance of Encryption on a network?
    What is multicast routing ?
    What is the importance of Encryption on a network?
    What is multicast routing?
    What is SMTP?
    What is the difference between CSMA/CD and CSMA/CA?



    Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes

    Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

    MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
    MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

    GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

    IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
    IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

    SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
    SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |




    Copyright ©2003-2016 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions



    Cache = 0.009766 Seconds