1.

Why do we use the optional argument [OR REPLACE] in a CREATE TRIGGER command?

Answer»

Each subprogram in PL/SQL has a name and a list of parameters. With that, it is having the following parts:

  • Declaration
  • Executable
  • Exception Handling

Let us now see them one by one:

  • Declaration

It contains declarations of cursors, constants, variables, exceptions, etc.

  • Executable

Had STATEMENTS that perform actions.

  • Exception Handling

The code that handles run-time errors.

The following is the syntax to create a subprogram (procedure):

CREATE [OR REPLACE] PROCEDURE name_of_procedure [(parameter_name [IN | OUT | IN OUT] type [, ...])] {IS | AS} BEGIN  < procedure_body > END name_of_procedure;

Here,

  • CREATE [OR REPLACE] means a new procedure is created or MODIFIES the existing one.
  • name_of_procedure is the procedure name.
  • procedure_body is the executable part.


Discussion

No Comment Found