Geeks Talk

Prepare for your Next Interview




select * from

This is a discussion on select * from within the SQL forums, part of the Databases category; select * from emp retrieves multiple records in emp. but why do we use cursors to retrieve multiple records?can we band using cursors concept ?can any body expain the differences ...


Go Back   Geeks Talk > Databases > SQL

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-04-2008
Banned
 
Join Date: Feb 2008
Location: bangalore
Posts: 32
Thanks: 9
Thanked 2 Times in 2 Posts
jayanth511 is on a distinguished road
select * from

select * from emp retrieves multiple records in emp.

but why do we use cursors to retrieve multiple records?can we band using cursors concept ?can any body expain the differences between select and cursor concept

and one thing is it is better that to use the cursor when u are trying to fetch less than 3% of records from the utilities.most of times set based operations can be used instead of cursors.what are set based operations.
regards
jayanth
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-04-2008
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,432
Thanks: 8
Thanked 126 Times in 113 Posts
debasisdas will become famous soon enoughdebasisdas will become famous soon enough
Re: select * from

So that we can fetch the records one bay one and process them as per user requirements.
Reply With Quote
  #3 (permalink)  
Old 03-04-2008
Banned
 
Join Date: Feb 2008
Location: bangalore
Posts: 32
Thanks: 9
Thanked 2 Times in 2 Posts
jayanth511 is on a distinguished road
Re: select * from

whatis set based operations
Reply With Quote
  #4 (permalink)  
Old 03-04-2008
Junior Member
 
Join Date: Feb 2008
Location: Edinburgh
Posts: 21
Thanks: 3
Thanked 2 Times in 2 Posts
su123 is on a distinguished road
Re: select * from

Hi Jayanth,
UNION ALL,UNION,MINUS,INTERSECT All these are called set based operators,
And the work done by all them is called set based operations.
Reply With Quote
  #5 (permalink)  
Old 03-04-2008
Expert Member
 
Join Date: Sep 2007
Posts: 754
Thanks: 22
Thanked 64 Times in 63 Posts
krishnaindia2007 is on a distinguished road
Re: select * from

Dear jayath,

In pl/sql you can't access the result of select statement directly unless you bring it into variables using select into statement.

An sql query may return zero , one or more rows. If a query returns zero rows it raises no_data_found exception. If a query returns more than one row it raises too_many_rows exception.so it is must to declare explicit cursor to process multiple rows in pl/sql.

Whenever we execute dml statements oracle uses private sql area to store the information. Cusors concept allows you to name that private sql area and access information stored in it.

UNION ,UNION ALL ,MINUS,INTERSECT are called set operators.

I hope now it is clear to you.

Regards
krishna

Last edited by krishnaindia2007 : 03-04-2008 at 11:20 PM.
Reply With Quote
Reply

  Geeks Talk > Databases > SQL


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Select row by repeating priyasp_msit SQL 3 06-27-2008 06:13 AM
Select within select neeraj_sigh SQL 7 12-09-2007 04:59 AM
Which course to select fo IC engines Geek_Guest Career Advice 0 09-20-2007 03:30 AM
Singleton select sdresh MainFrame 2 09-11-2007 03:20 AM
I am not able to select the pop-up window Geek_Guest QTP 0 07-12-2007 06:20 AM


All times are GMT -4. The time now is 09:55 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved