Real Questions
Real Questions
A. If errors occur during the compilation of a trigger, the trigger is still created.
B. If errors occur during the compilation of a trigger you can go into SQL* Plus and
query theUSER_ TRIGGERS data dictionary view to see the compilation errors.
C. If errors occur during the compilation of a trigger you can use the SHOW ERRORS
command within iSQL* Plus to see the compilation errors.
D. If errors occur during the compilation of a trigger you can go into SQL *Plus and
query theUSER_ ERRORS data dictionary view to see compilation errors. Answer:
A, C, D
Q7-Which two dictionary views track dependencies?( Choose two)
A. USER_ SOURCE
B. UTL_ DEPTREE
C. USER_ OBJECTS
D. DEPTREE_ TEMPTAB
E. USER_ DEPENDENCIES
F. DBA_DEPENDENT_ OBJECTS
Answer: D, E
Q8-CREATE OR REPLACE FUNCTION calctax( sal NUMBER) RETURN NUMBER
IS BEGIN RETURN( sal * 0.05); END; If you want to run the above function from the
SQL* Plus prompt, which statement is true?
A. You need to execute the commandCALCTAX( 1000);.
B. You need to execute the command EXECUTE FUNCTION calctax;.
C. You need to create a SQL* Plus environment variable X and issue the command:
X :=CALCTAX( 1000);.
D. . You need to create a SQL* Plus environment variable X and issue the command
EXECUTE: X := CALCTAX;
E. You need to create a SQL* Plus environment variable X and issue the command
EXECUTE: X :=CALCTAX( 1000);
Answer: E
Q9-What part of a database trigger determines the number of times the trigger body
executes?
A. Trigger type
B. B. Trigger body
C. C. Trigger event
D. D. Trigger timing
Answer: A
Q10-When creating a function in SQL* Plus, you receive this message: Warning:
Function created with compilation errors.
Which command can you issue to see the actual error message?
A. SHOWFUNCTION_ ERROR
B. SHOWUSER_ ERRORS
C. SHOW ERRORS
D. SHOWALL_ ERRORS
Answer: C
Q17- How can you migrate from a LONG to a LOB data type for a column?
END;
This trigger results in an error after this SQL statement is entered:
DELETE FROMEmp_ tab WHERE Empno = 7499;
How do you correct the error?
A. Change the trigger type to a BEFORE DELETE.
B. Take out the COUNT function because it is not allowed in a trigger.
C. Remove theDBMS_ OUTPUT statement because it is not allowed in a trigger.
D. Change the trigger to astatement- level trigger by removing FOR EACH ROW.
Answer: D
Q26- Which two program declarations are correct for a stored program unit?( Choose
two)
A. CREATE OR REPLACE FUNCTIONtax_ amt(p_ id NUMBER) RETURN
NUMBER
B. CREATE OR REPLACE PROCEDUREtax_ amt(p_ id NUMBER) RETURN
NUMBER
C. CREATE OR REPLACE PROCEDUREtax_ amt(p _id NUMBER,p_ amount OUT
NUMBER)
D. CREATE OR REPLACE FUNCTIONtax_ amt(p_ id NUMBER)
RETURNNUMBER( 10,2)
E. CREATE OR REPLACE PROCEDUREtax_ amt(p_ id NUMBER,p_ amount
OUTNUMBER( 10, 2))
Answer: A, C
Q27- You need to implement a virtual private database( vpd). In order to have the
vpd functionality, a trigger is required to fire when every user initiates a session in
the database. What type of trigger needs to be created?
A. DML trigger
B. System event trigger
C. INSTEAD OF trigger
D. Application trigger
Answer: B
Q28- You need to disable all triggers on the EMPLOYEES table. Which command
accomplishes this?
A. None of these commands; you cannot disable multiple triggers on a table in
one command.
B. ALTER TRIGGERS ON TABLE employees DISABLE;
C. ALTER employees DISABLE ALL TRIGGERS;
D. ALTER TABLE employees DISABLE ALL TRIGGERS;
Answer: D
NOTE : THIS QUESTION CAME BY OCNTRARY MEANING ENABLE ALL
TRIGGERS AND NOT DISABLING THEM
Q29- Examine this code: CREATE OR REPLACE FUNCTIONcalc_ sal(p_ salary
NUMBER) RETURN NUMBER ISv_ raiseNUMBER( 4,2) DEFAULT 1.08; BEGIN
RETURNv_ raise *p_ salary; ENDcalc_ sal; /
Which statement accurately call the stored functionCALC_ SAL?( Choose two)
A. UPDATE employees(calc_sal( salary)) SET salary = salary *calc_sal( salary);
B. . INSERTcalc_sal( salary) NOT employees WHEREdepartment_ id = 60;