PCS Infotech Papers: Sample Questions 11 - 12 of 25

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 11

» Database » MySQL

True-False▾

Question

Is the Following Statement True or False?

SQL % ISOPEN for implicit cursor is always evaluate to false

Answer

FALSE

Explanation

Atrributes of SQL cursor.

Atrributes of SQL Cursor.

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 number: 12

» Database » MySQL

Fill-Blanks▾

Raise_application_error is used for ________.

Answer

Explanation

Understanding of Raise application error

Understanding of Raise Application Error

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.