PCS Infotech Papers: Sample Questions 1 - 2 of 25

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

Question number: 1

» Database » MySQL

Fill-Blanks▾

PRAGMA_EXCEPTION_INIT (message, code no) ________exceptions are executed at.

Answer

Explanation

Pragma exception_INIT

Pragma exception_INIT

Pragma exception_INIT

  • The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle error.

  • Pragma exception_init allows replacing oracle message by user defined messages.

  • Instructs compiler to associate the specific message to oracle predefined message at compile time.

  • Provides an error message with a specific oracle error.

  • For example, PRAGMA EXCEPTION_INIT (exception name, oracle error number).

    PRAGMA

  • PRAGMA keyword signifies the statements is a compiler directive.

  • It is not processed when the PL/SQL block is executed.

    Syntax:

  • PRAGMA EXCEPTION_INT (exception, error_number);

Question number: 2

» Database » MySQL

True-False▾

Question

Is the Following Statement True or False?

NO_DATA_FOUND (exception) gives the same result.

Answer

TRUE

Explanation

Define Exception Handlar

Define Exception Handlar

Define Exception Handlar

  • PL/SQL provides many pre-defined exceptions executed when database rule is violated.

  • Predefined exception NO_DATA_FOUND means a SELECT INTO statement returns no rows:

    • Single row select returned no rows

    • Program referenced a deleted table

    • Program referenced uninitialized element in an associative array.

  • SELECT returns value if one is available, and “NULL” instead of a NO_DATA_FOUND exception.

  • NO_DATA_FOUND is captured in the EXCEPTION block.

  • Exceptions are not only raised by the server on internal database error, but also raised by RAISE command.