Database-Oracle [3i Infotech Placement]: Sample Questions 3 - 4 of 132

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 3

Oracle

Question

MCQ▾

What is the Result of the following ‘VIK’ || NULL|| ‘RAM’ ?

Choices

Choice (4)

a.

VIKRAM

b.

VIK

c.

Error

d.

NULL

Answer

a.

Explanation

  • VIKRAM is the result of the ‘VIK’ || NULL|| ‘RAM’ .
  • ‘VIK’ || NULL|| ‘RAM’ - ignores the null function so, VIK + RAM
  • So the return result is VIKRAM.

NULLS

  • Most of aggregate functions ignores nulls.
  • Aggregate is function where the value of multiple rows is grouped as input to form a single value.
  • For example- average of five values 1000, null, null, null, and 2000- ignores the nulls and calculates the average of 1000 and 2000
  • So,
  • Null represents a lack of data, a null cannot equal or unequal to value or to another null.

Question 4

Oracle

Question

MCQ▾

Which of the following is not correct about an Exception?

Choices

Choice (4)

a.

Process terminates after completion of error sequence.

b.

A Procedure or Sequence of statements may be processed.

c.

Raised automatically/Explicitly in response to an ORACLE_ERROR

d.

An exception will be raised when an error occurs in that block

Answer

a.

Explanation

Introduction to Exception Handling

In PL/SQL, an error condition is called an exception, which:

  • Defines its own declarative part of any PL/SQL block or package.
  • Can be internal or user defined
  • Divide by zero and out of memory is example.
  • Can be either indirectly define or user-defined.
  • Raised exceptions are handled by separate routines called exception handlers.
  • After an exception handler runs, the current block stops executing and the enclosing block resumes with the next statement.
  • When an error occurs, an exception is automatically raised.

Types of Exceptions

  • Predefine
    • Error conditions that are defined by PL/SQL
  • Non-predefine
    • Include any standard Timetan errors
  • User-define
    • Exceptions are used in the same way as in oracle database
Types of Exceptions

Developed by: