what exactly are cursors, the actual mouse pointed in client app?

  • what exactly are cursors, the actual mouse pointed in client app?

  • It's basically a recordset that you can open/manipulate on the server. It's also viewed as an evil by good coders/dbas because it takes much more time to execute things on a row by row basis than on a set of rows.

  •  

    thanks!!!

    for further clarification.

    is there no relationship to a the mouse pointing device?

    it is a different name for a certain kind of row by row manipulation record set?

     

     

    so what is the @@FETCH CURSOR function do, return the recordset?\\

    TANKs!!!

  • @@FETCH_STATUS is a global variable telling you if the fetch was successfull.

    This is an exemple of a cursor (that would have absolutely no use...)

    DECLARE Employee_Cursor CURSOR FOR

    SELECT LastName, FirstName FROM Northwind.dbo.Employees

    OPEN Employee_Cursor --populate the cursor

    FETCH NEXT FROM Employee_Cursor --fetch a row that you would normally enter in variables at this point

    WHILE @@FETCH_STATUS = 0 --while the fetch is successfull

    BEGIN

    FETCH NEXT FROM Employee_Cursor --goto next record

    END

    CLOSE Employee_Cursor --close cursor

    DEALLOCATE Employee_Cursor --release the cursors resources

  • The database cursor is an acronym for CURrent Set Of Records (or Rows). The mouse cursor is derived from the Latin word for "to run" (http://www.etymonline.com/index.php?l=c&p=33) and is an extension of the name for the sliding part of a slide rule or other instrument. Two words with the same spelling but completely different meanings and etymologies used in the same field - don't you just love the English language?

    Scott

    --
    Scott

  • and here was me thinking a cursor was that thing that blinked at you in a word document.

     

    Man you know some odd stuff..

  • It's my life's ambition to prove that everyone loves a smartarse.

    --
    Scott

  • As Scott said, a cursor is just that, too.

  • Ya but nobody loves me... does that mean something?

  • Well I got married last year, so that's one convert!

    --
    Scott

  • It means that not everyone loves a smartarse.....

    Take heart Remi - I'm sure you have the gratitude and admiration of the zillions of people you've helped this past year...who needs love when you've got that right ?!







    **ASCII stupid question, get a stupid ANSI !!!**

  • Good point... but I guess it's more in the billions helped... I can't help to think that some of us on this Earth are not geeks .

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply