Database-MySQL [PCS Infotech Placement]: Sample Questions 10 - 11 of 23

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 10

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.

Question 11

Edit

Write in Short

Short Answer▾

Explain operator precedence in PL/SQL.

Explanation

Rules of Operator Precedence
  • Operator precedence determines the grouping of terms in an Expression.
  • When evaluating an expression containing multiple operators, highest precedence evaluated before those with lower precedence.
  • Precedence is the order in which runtime evaluates different operators in the same expression.
  • Oracle evaluates operators with equal precedence from left to right within an expression.
  • Multiplication operators have higher precedence than the addition operators.
  • Ex.
  • Here, x is 11, not 16 because of the operator ⚹ has higher precedence then +
  • So first 3 ⚹ 2 is done and then result added to 5.
  • Operators with the highest precedence appear at the top of the above table; those with the lowest precedence appear at the bottom.

Developed by: