DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Reading, U.K
    geme the correct answer:

    You develop a PL/SQL block that will be used in an overall application
    that records grants for political asylum for Olympic athletes to the country
    where the games are held. The cursor definition in this block is cursors
    asy_csr is select NAME from CONTESTANT. As you loop through the
    cursor, you want the ability to update the record back in the table that
    corresponds to the record in the cursor. Which of the following choices
    best identifies the way to do so without explicit comparison between the
    NAME value in the cursor and the NAME value in the table?
    A. update CONTESTANT set COUNTRY = ’USA’ where current of
    B. Redefine the cursor as cursor cnt_csr is select NAME from
    CONTESTANT for update;
    C. update CONTESTANT set COUNTRY = ’USA’ where NAME =
    D. You cannot achieve this functionality with PL/SQL.

  2. #2
    Join Date
    May 2002
    Answer A works - that is what the "where current of" clause is for (can be used for updates and deletes inside a cursor to make changes to last fetched row).

    B: Select for update locks the rows in question. Normally, select does not lock rows.

    C: where NAME = cursor.NAME is ambiguous

    D: eliminated by choosing A

    [Edited by stecal on 05-24-2002 at 02:04 PM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.