C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




What is cursors.


Posted Date: 08 Jul 2008      Total Responses: 13

Posted By: samul       Member Level: Gold     Points: 1


What is cursors.



Responses

Author: Subhi    08 Jul 2008Member Level: GoldRating:     Points: 5
A special symbol, usually a solid rectangle or a blinking underline
character, that signifies where the next character will be
displayed on the screen. To type in different areas of the screen,
you need to move the cursor. You can do this with the arrow keys,
or with a mouse if your program supports it.

A device, similar in appearance to a mouse, that is used to sketch
lines on a digitizing tablet. Cursors for digitizing tablets are
sometimes called pucks.



Author: sivangari    08 Jul 2008Member Level: GoldRating:     Points: 6
hi,
In SQL procedures, a cursor make it possible to define a result set (a set of data rows) and perform complex logic on a row by row basis. By using the same mechanics, an SQL procedure can also define a result set and return it directly to the caller of the SQL procedure or to a client application.

A cursor can be viewed as a pointer to one row in a set of rows. The cursor can only reference one row at a time, but can move to other rows of the result set as needed.

To use cursors in SQL procedures, you need to do the following:
Declare a cursor that defines a result set.
Open the cursor to establish the result set.
Fetch the data into local variables as needed from the cursor, one row at a time.
Close the cursor when done
To work with cursors you must use the following SQL statements:
DECLARE CURSOR
OPEN
FETCH
CLOSE



Author: Payal Jain    08 Jul 2008Member Level: GoldRating:     Points: 6
Operations in a relational database act on a complete set of rows. The set of rows returned by a SELECT statement consists of all the rows that satisfy the conditions in the WHERE clause of the statement. This complete set of rows returned by the statement is known as the result set. Applications, especially interactive online applications, cannot always work effectively with the entire result set as a unit. These applications need a mechanism to work with one row or a small block of rows at a time. Cursors are an extension to result sets that provide that mechanism.

Cursors extend result processing by:

Allowing positioning at specific rows of the result set.


Retrieving one row or block of rows from the current position in the result set.


Supporting data modifications to the rows at the current position in the result set.


Supporting different levels of visibility to changes made by other users to the database data that is presented in the result set.


Providing Transact-SQL statements in scripts, stored procedures, and triggers access to the data in a result set.



Author: Ratheesh    08 Jul 2008Member Level: GoldRating:     Points: 1
Cursors allow row-by-row prcessing of the resultsets.

Types of cursors: Static, Dynamic, Forward-only, Keyset-driven. See books online for more information.

Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip, where as a normal SELECT query makes only one rowundtrip, however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Furthere, there are restrictions on the SELECT statements that can be used with some types of cursors.

Most of the times, set based operations can be used instead of cursors.




A cursor is the position indicator on a computer display screen where a user can enter text. In an operating system with a graphical user interface (GUI), the cursor is also a visible and moving pointer that the user controls with a mouse, touch pad, or similar input device. The user uses the pointing cursor and special input buttons to establish where the position indicator cursor will be or to select a particular program to run or file to view. Typically, the pointing cursor is an arrow and the text entry position cursor is a blinking underscore or vertical bar. Most operating systems allow the user to choose another appearance for the cursor.
In the Windows operating system, the pointing cursor turns into a small pointing-hand image when it moves or hovers over a specific object. This is commonly the case when the cursor passes over a text or image link on a Web page. The cursor changes into an hourglass image while the system is launching a requested program



Author: chandramohan    08 Jul 2008Member Level: GoldRating:     Points: 1
Alter PROCEDURE dbo.sp_InsertRecords
AS
Declare @id int
-- first we'll pull some records out of our table.
DECLARE CursorQuery CURSOR FOR
SELECT ID FROM myTable WHERE MyRecord > 15
OPEN CursorQuery
-- we're going to fetch our record into the ID variable which we'll use for inserting a related record.
FETCH NEXT FROM CursorQuery
INTO @ID
PRINT 'Record Status' + CAST(@@FETCH_STATUS as varchar)
WHILE @@FETCH_STATUS = 0
BEGIN
-- now insert the id from the main table into the related table.
INSERT INTO
RelatedTable
(relatedID)
VALUES
(@id)
FETCH NEXT FROM CursorQuery
INTO @ID
END
CLOSE CursorQuery
DEALLOCATE CursorQuery
RETURN

A special symbol, usually a solid rectangle or a blinking underline
character, that signifies where the next character will be
displayed on the screen. To type in different areas of the screen,
you need to move the cursor. You can do this with the arrow keys,
or with a mouse if your program supports it.

A device, similar in appearance to a mouse, that is used to sketch
lines on a digitizing tablet. Cursors for digitizing tablets are
sometimes called pucks.



Author: Ebenezer    08 Jul 2008Member Level: SilverRating:     Points: 6
hi

A cursor is the position indicator on a computer display screen where a user can enter text. In an operating system with a graphical user interface (GUI), the cursor is also a visible and moving pointer that the user controls with a mouse, touch pad, or similar input device. The user uses the pointing cursor and special input buttons to establish where the position indicator cursor will be or to select a particular program to run or file to view. Typically, the pointing cursor is an arrow and the text entry position cursor is a blinking underscore or vertical bar. Most operating systems allow the user to choose another appearance for the cursor.
In the Windows operating system, the pointing cursor turns into a small pointing-hand image when it moves or hovers over a specific object. This is commonly the case when the cursor passes over a text or image link on a Web page. The cursor changes into an hourglass image while the system is launching a requested program, or while a Web page is loading after the user has clicked on a link.

2) In some database programs, the term cursor is an acronym that stands for current set of records. When a group of records is selected, that group is called the current set. Selection is usually done using the pointing device, although the keyboard shift and arrow keys can also be used in some programs.



http://www.google.com/search?q=what+is+cursors&rls=com.microsoft:en-us:IE-SearchBox&ie=UTF-8&oe=UTF-8&sourceid=ie7&rlz=1I7HPND



regards



Author: Kumar Velu    10 Jul 2008Member Level: DiamondRating:     Points: 6
Microsoft SQL Server statements produce a complete result set, but there are times when the results are best processed one row at a time. Opening a cursor on a result set allows processing the result set one row at a time. You can assign a cursor to a variable or parameter with a cursor data type.

Cursors extend result processing by:

Allowing positioning at specific rows of the result set.
Retrieving one row or block of rows from the current position in the result set.
Supporting data modifications to the rows at the current position in the result set.
Supporting different levels of visibility to changes made by other users to the database data that is presented in the result set.


Providing Transact-SQL statements in scripts, stored procedures, and triggers access to the data in a result set.



Author: Sridhar R    15 Jul 2008Member Level: DiamondRating:     Points: 1
A cursor is a moving placement or pointer that indicates a position. English-speakers have used the term with this meaning since the 16th century, for a wide variety of movable or mobile position-markers.

The literal meaning of the original Latin word cursor expresses the idea of someone or something that runs. Especially in the plural, Cursores 'runners', it was the name of certain functions, originally messengers. Cursor was also a Roman cognomen used by gens Papiria.

The word cursor may refer to any of the following:

* Cursor (slide rules)
* Cursor (typewriters)
* Cursor (computers)
* Cursor (databases)

* Cursor (magazine) was also the name of an early computer-based "magazine" that was distributed on cassette in the late 1970s. Each "issue" contained programs, utilities, and games and was a forerunner of today's computer magazines that come packaged with CD-ROMs and DVD-ROMs. Cursor was produced for users of the Commodore PET.



Author: Ashok    15 Jul 2008Member Level: GoldRating:     Points: 1
Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time. For example, you can use cursor to include a list of all user databases and make multiple operations against each database by passing each database name as a variable.

The server side cursors were first added in the SQL Server 6.0 release and are now supported in all editions of SQL Server 7.0 and SQL Server 2000.



Author: UltimateRengan    22 Jul 2008Member Level: DiamondRating:     Points: 1
Cursors allow row-by-row prcessing of the resultsets.

Types of cursors: Static, Dynamic, Forward-only, Keyset-driven. See books online for more information.

Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip, where as a normal SELECT query makes only one rowundtrip, however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Furthere, there are restrictions on the SELECT statements that can be used with some types of cursors.

Most of the times, set based operations can be used instead of cursors.




A cursor is the position indicator on a computer display screen where a user can enter text. In an operating system with a graphical user interface (GUI), the cursor is also a visible and moving pointer that the user controls with a mouse, touch pad, or similar input device. The user uses the pointing cursor and special input buttons to establish where the position indicator cursor will be or to select a particular program to run or file to view. Typically, the pointing cursor is an arrow and the text entry position cursor is a blinking underscore or vertical bar. Most operating systems allow the user to choose another appearance for the cursor.
In the Windows operating system, the pointing cursor turns into a small pointing-hand image when it moves or hovers over a specific object. This is commonly the case when the cursor passes over a text or image link on a Web page. The cursor changes into an hourglass image while the system is launching a requested program




Author: UltimateRengan    22 Jul 2008Member Level: DiamondRating:     Points: 1
Cursors allow row-by-row prcessing of the resultsets.

Types of cursors: Static, Dynamic, Forward-only, Keyset-driven. See books online for more information.

Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip, where as a normal SELECT query makes only one rowundtrip, however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Furthere, there are restrictions on the SELECT statements that can be used with some types of cursors.

Most of the times, set based operations can be used instead of cursors.




A cursor is the position indicator on a computer display screen where a user can enter text. In an operating system with a graphical user interface (GUI), the cursor is also a visible and moving pointer that the user controls with a mouse, touch pad, or similar input device. The user uses the pointing cursor and special input buttons to establish where the position indicator cursor will be or to select a particular program to run or file to view. Typically, the pointing cursor is an arrow and the text entry position cursor is a blinking underscore or vertical bar. Most operating systems allow the user to choose another appearance for the cursor.
In the Windows operating system, the pointing cursor turns into a small pointing-hand image when it moves or hovers over a specific object. This is commonly the case when the cursor passes over a text or image link on a Web page. The cursor changes into an hourglass image while the system is launching a requested program




Author: Vidhya    31 Jul 2008Member Level: GoldRating:     Points: 1
hi,


1) A cursor is the position indicator on a computer display screen where a user can enter text. In an operating system with a graphical user interface (GUI), the cursor is also a visible and moving pointer that the user controls with a mouse, touch pad, or similar input device. The user uses the pointing cursor and special input buttons to establish where the position indicator cursor will be or to select a particular program to run or file to view. Typically, the pointing cursor is an arrow and the text entry position cursor is a blinking underscore or vertical bar. Most operating systems allow the user to choose another appearance for the cursor.
In the Windows operating system, the pointing cursor turns into a small pointing-hand image when it moves or hovers over a specific object. This is commonly the case when the cursor passes over a text or image link on a Web page. The cursor changes into an hourglass image while the system is launching a requested program, or while a Web page is loading after the user has clicked on a link.

2) In some database programs, the term cursor is an acronym that stands for current set of records. When a group of records is selected, that group is called the current set. Selection is usually done using the pointing device, although the keyboard shift and arrow keys can also be used in some programs.





Author: Satyanarayan SushilKumar Bajoria    24 Sep 2008Member Level: DiamondRating:     Points: 6
Hi,

Cursor:
A cursor is a database object that helps in accessing and manipulating data in a given result set.The main advantage of cursors is that you can process data row-by-row.

A result set is defined as a collection of rows obtained from a SELECT statement that meet the criteria specified in te WHERE clause.

Cursors,therefore,serve as a mechanism for applications to operate on a single row or a set of rows.Cursors enable the processing of rows in the given result set in the following ways:

1>Allow specific rows to be retrieved from the result set.
2>Allow the current row in the result set to be modified.
3>Help navigate from the current row in the result set to a different row.
4>Allow data modified by other users to be visible in the result set.

Structure of Cursors:
The following tasks need to be performed while using a cursor in SQL Server:

1>The cursor needs to be defined and its attributes need to be set.
2>The cursor needs to be opened.
3>The required rows need to be fetched from the cursor.Fetch refers to the process of retrieving a row from the result set.
4>The data in the current row of the cursor can be modified,if required.
5>The cursor needs to be closed.
6>The cursor should be deallocated.This is a good practice as resourses used by the cursor are released.

Regards
S.S.Bajoria



Post Reply
You must Sign In to post a response.
Next : dot.net
Previous : dropdownlist related problem
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

conference call

Contact Us    Privacy Policy    Terms Of Use