Oracle9i program with pl/sql Sample Questions:
1. Local procedure A calls remote procedure B.
Procedure B was compiled at 8 A.M.
Procedure A was modified and recompiled at 9 A.M. Remote procedure B was later modified and recompiled at 11 A.M.
The dependency mode is set to TIMESTAMP.
What happens when procedure A is invoked at 1 P.M?
A) There is no affect on procedure A and it runs successfully.
B) Procedure A is invalidated and recompiles for the first time it is invoked.
C) Procedure B is invalidated and recompiles when invoked.
D) Procedure A is invalidated and recompiles for the second time it is invoked.
2. You need to create a trigger on the EMP table that monitors every row that is changed and places this information into the AUDIT_TABLE.What type of trigger do you create?
A) FOR EACH ROW trigger on the AUDIT_TABLE table.
B) FOR EACH ROW statement-level trigger on the EMPtable.
C) Statement-level trigger on the EMP table.
D) FOR EACH ROW trigger on the EMP table.
E) Statement-level trigger on the AUDIT_TABLE table.
3. Examine this code:
CREATE OR REPLACE FUNCTION gen_email_name
(p_first_name VARCHAR2, p_last_name VARCHAR2, p_id NUMBER)
RETURN VARCHAR2
IS
v_email_name VARCHAR2(19=;
BEGIN
v_email_name := SUBSTR(p_first_name, 1, 1) ||
SUBSTR(p_last_name, 1, 7) ||
'@Oracle.com';
UPDATE employees
SET email = v_email_name
WHERE employee_id = p_id;
RETURN v_email_name;
END;
Which statement removes the function?
A) DELETE gen_email_name;
B) TRUNCATE gen_email_name;
C) REMOVE gen_email_name;
D) ALTER FUNCTION gen_email_name REMOVE;
E) DROP FUNCTION gen_email_name;
4. You disabled all triggers on the EMPLOYEES table to perform a data load. Now, you need to enable all triggers on the EMPLOYEES table. Which command accomplished this?
A) ALTER employees ENABLE ALL TRIGGERS;
B) You cannot enable multiple triggers on a table in one command.
C) ALTER TRIGGERS ON TABLE employees ENABLE;
D) ALTER TABLE employees ENABLE ALL TRIGGERS;
5. Examine this package specification:
CREATE OR REPLACE PACKAGE concat_all
IS
v_string VARCHAR2(100);
PROCEDURE combine (p_num_val NUMBER);
PROCEDURE combine (p_date_val DATE);
PROCEDURE combine (p_char_val VARCHAR2, p_num_val NUMBER);
END concat_all; /
Which overloaded COMBINE procedure declaration can be added to this package specification?
A) PROCEDURE combine (p_no NUMBER);
B) PROCEDURE concat_all
(p_num_val VARCHAR2, p_char_val NUMBER);
C) PROCEDURE combine;
D) PROCEDURE combine (p_val_1 VARCHAR2, p_val_2 NUMBER;
Solutions:
Question # 1 Answer: D | Question # 2 Answer: D | Question # 3 Answer: E | Question # 4 Answer: D | Question # 5 Answer: C |