CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.




Get it now !!
Send your Resume to 6000 Companies

Search Interview Questions

Question: State the advantage and disadvantage of Cursor?

Answer: 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.



Category PL-SQL Interview Questions & Answers - Exam Mode / Learning Mode
Rating (3.3) By 81 users
Added on 8/18/2011
Views 6926
Rate it!
Question: State the advantage and disadvantage of Cursor?


Answer:

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


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

Answered by: Praveen Jindal | Date: 3/3/2008 | Contact Praveen Jindal Contact Praveen Jindal

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

Answered by: good programmer | Date: 4/8/2008 | Contact good programmer Contact good programmer

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

Answered by: sudipta das | Date: 4/18/2008 | Contact sudipta das Contact sudipta das

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

Answered by: Sachin Nagpal | Date: 3/10/2009 | Contact Sachin Nagpal Contact Sachin Nagpal

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

Answered by: HarshDeep Singh | Date: 9/25/2009 | Contact HarshDeep Singh Contact HarshDeep Singh

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

Answered by: Amit Singh | Date: 2/9/2010 | Contact Amit Singh Contact Amit Singh

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

Answered by: Ashish Khudlani | Date: 3/30/2010 | Contact Ashish Khudlani Contact Ashish Khudlani

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

Answered by: narendra | Date: 5/5/2010 | Contact narendra Contact narendra

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

Answered by: hanumantha reddy.d | Date: 5/26/2010 | 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.

Post your answer here

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?

2)What is meant by forward declaration in functions - PL-SQL Interview Questions & Answers" class="btn btn-primary btn-xs">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 - Exam Mode / Learning Mode




India News Network
Latest 20 Questions
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
"Holiday Packages" announced as an advertisement are an example of _________: (a) Offer (b) Counter Offer (c) Invitation to Offer (d) None of the above
A match fixing contract between a player and a broker is a: (a) Valid Contract (b) Unenforceable Contract (c) Void Contract (d) Illegal Contract
When a bookseller sells a book on cash payment then it is called as ___________: (a) Unilateral Contract (b) Bilateral Contract (c) Executed Contract (d) Executory Contract
____________ agreements are created by situation: (a) Written (b) Oral (c) Void (d) Implied
Cache = 0.031006 Seconds