Results 1 to 5 of 5

Thread: Cursor

  1. #1
    Contributing Member
    Join Date
    Mar 2008
    Answers
    66

    Cursor

    I know cursor variable is a pointer of type REF CURSOR.

    But what about cursor. Whether a cursor is a pointer or variable?


  2. #2
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: Cursor

    A Cursor is always a pointer.

    For every sql statement execution certain area in memory is allocated. This are is called private sql area or context area. Cursor acts as a pointer to this context area.

    When you declare a cursor, you get a pointer variable, which does not point any thing. When the cursor is opened, memory is allocated and the cursor structure is created. The cursor variable now points the cursor. When the cursor is closed the memory allocated for the cursor is released.

    The only difference between cursor and cursor variable is cursor is static in nature. Once a statement is assosiated with it we can't change its contents.

    Where as a cursor variable can be assosiated with different queries at runtime depeding upon the requirement.


  3. #3
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Cursor

    Cursor is a pointer .


  4. #4
    Contributing Member
    Join Date
    Jul 2007
    Answers
    42

    Re: Cursor

    cursor is handle for the memory assosiated with a specific statement.

    cursor is requried to process rows for inducial queries return multiple rows.

    this is 2 types
    implicit
    explicit

    implict means private sql area.
    explict we r select mutiple records


  5. #5
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: Cursor

    >>implict means private sql area.

    Implicit cursors use private sql area or context area to store its information.

    >>cursor is requried to process rows for inducial queries return multiple rows.

    Can't we use a cursor to process a single row.

    Every sql statement is a cursor.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact