Database [3i Infotech Placement]: Sample Questions 210 - 210 of 294

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

Question 210

Database

Question

MCQ▾

Is it possible to Enable or Disable a database trigger?

Choices

Choice (4)

a.

No

b.

Yes

c.

Question does not provide sufficient data or is vague

d.

All of the above

Answer

b.

Explanation

  • Database triggers are procedures it is stored in the database and activated when specific conditions occur, like adding a row to a table.
  • Supplement the standard capabilities of the database for highly customized database management system.

    Triggers Have Two Distinct Modes

  • Enabled
    • An enabled trigger executes its trigger body if a triggering statement is issued and the trigger restriction.
  • Disabled
    • A disabled trigger does not execute its trigger body and the trigger restriction evaluates to true.
The Two Distinct Modes

Enabling Trigger

  • If we have disabled a trigger on a table and we enable the trigger again.
  • We can do this with the ALTER TRIGGER statement.

    Syntax

  • ALTER TRIGGER trigger_name ENABLE;

    Trigger_name

  • The name of the trigger that is enable.

    Eg

  • ALTER TRIGGER order_before_insert ENABLE;

Disable Trigger

  • Created a Trigger in oracle, we might find that we are required to disable the trigger.
  • we can do this with the ALTER TRIGGER statement.

Syntax

  • ALTER TRIGGER trigger_name DISABLE;

    Trigger_name

  • The name of the trigger to disable.

    Ex

  • ALTER TRIGGER order_before_insert DISABLE;

Developed by: