You are on page 1of 3

28 What are the components of a PL/SQL Block ?

Declarative part, Executable part and Exception part.

Datatypes PL/SQL

29 What are the components of a PL/SQL block ?

A set of related declarations and procedural statements is called block.

30 What are advantages fo Stored Procedures /

Extensibility,Modularity, Reusability, Maintainability and one time compilation.

31 Name the tables where characteristics of Package, procedure and functions are stored ?

User_objects, User_Source and User_error.

32 Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database
Trigger ? Why ?

It is not possible. As triggers are defined for each table, if you use COMMIT of ROLLBACK in a trigger,
it affects logical transaction processing.

33 How packaged procedures and functions are called from the following?
a. Stored procedure or anonymous block
b. an application program such a PRC C, PRO COBOL

variable := PACKAGE NAME.FUNCTION NAME (arguments);
variable := PACKAGE NAME.FUNCTION NAME (arguments);
c. EXECUTE PACKAGE NAME.PROCEDURE if the procedures does not have any
out/in-out parameters. A function can not be called.

34 How many types of database triggers can be specified on a table ? What are they ?

Insert Update Delete

Before Row o.k. o.k. o.k.

Before Statement o. o. If WHEN clause is specified.k. Implicit Cursor and Explicit Cursor. Exception. the trigger fires according to the returned Boolean value..k.k. o.k. then the trigger for each Row affected by the statement.. PL/SQL uses Implicit Cursors for queries..k. Database Triggers 38 Explain the two type of Cursors ? There are two types of cursors. They can be declared and used. If FOR EACH ROW clause is specified.k.After Row o... 35 Give the structure of the procedure ? PROCEDURE name (parameter list. o.) is local variable declarations BEGIN Executable statements. o. o.DELETE statement refers to the latest row fetched from a cursor. exception handlers end. o.. 37 Explain the usage of WHERE CURRENT OF clause in cursors ? WHERE CURRENT OF clause in an UPDATE.. . 36 Give the structure of the function ? FUNCTION name (argument list ..k.) Return datatype is local variable declarations Begin executable statements Exception execution handlers End. After Statement o.k. User defined cursors are called Explicit Cursors.k.

sal := calculate_sal ('a822'). A trigger does not apply to data loaded before the definition of the trigger. A constraint applies to existing data in the table and any statement that manipulates the table. therefore. . procedure is called as a PL/SQL statement calculate_bonus ('A822'). it does not guarantee all data in a table conforms to the rules established by an associated trigger.Packages and Database Triggers. A trigger can be used to enforce transitional constraints where as a declarative integrity constraint cannot be used. 2004 1 What are the different types of PL/SQL program units that can be defined and stored in ORACLE database ? Procedures and Functions.39 Explain how procedures and functions are called in a PL/SQL block ? Function is called as part of an expression. Programmatic Constructs Last Update: September 06. 3 What is difference between Procedures and Functions ? A Function returns a value to the caller where as a Procedure does not. 2 What are the differences between Database Trigger and Integrity constraints ? A declarative integrity constraint is a statement about the database that is always true.