Database [PCS Infotech Placement]: Sample Questions 11 - 12 of 25

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 11

Database
Edit

Statement

True-False▾

SQL % ISOPEN for implicit cursor is always evaluate to false

Answer

FALSE

Explanation

Atrributes of SQL Cursor
  • The % ISOPEN attribute is used with cursors.
  • For explicit and implicit cursor it evaluates to TRUE if the cursor is open.
  • Closing a closed cursor produces an error- Unlike host file processing- closing the same file twice generates no exception.
  • Ex. .

    IF c1 % ISOPEN THEN

    - continue

    ELSE

    CLOSE c1;

    END IF;

  • The % ISOPEN attribute is preceded by the cursor name.
  • % ISOPEN can be used in procedural statements but not from SQL.
  • SQL cursors closed automatically after use so the SQL % ISOPEN attribute will always evaluate to FALSE.

Question 12

Database
Edit

Question

Fill-Blanks▾

Raise_application_error is used for ________.

Answer

Explanation

Understanding of Raise Application Error
  • Raise_application_error is used to create own message for exception
  • Can provide descriptive named exceptions.
  • Procedure of package DBMS_STANDARD allows user_defined error from stored database triggers.
  • Errors and error message with raise_application_error can use error number in from 20000 to 20999.
  • The RAISE_APPLICATION_ERROR procedure raises an exception based on a user-provided error code and message. SYNTAX:

    Raise_application_error (error_number error_messages) ;

  • Mostly used to handle unwanted and unmanageable exceptions.

Developed by: