Professional Documents
Culture Documents
Correct
Correct
Correct
Correct
DECLARE
PRAGMA EXCEPTION_INIT(e_sal_excep,-02290);
e_sal_excep EXCEPTION;
DECLARE
e_sal_excep EXCEPTION;
PRAGMA EXCEPTION_INIT(e_sal_excep,-02290);
(*)
DECLARE
e_sal_excep EXCEPTION;
PRAGMA_EXCEPTION_INIT(e_sal_exception,-02290);
DECLARE
e_sal_excep EXCEPTION;
PRAGMA EXCEPTION_INIT(e_sal_excep,02290);
Correct
Correct
11. The following code does not violate any constraints and will not raise a
n ORA-02292 error. What will happen when the code is executed?
BEGIN
DECLARE
e_constraint_violation EXCEPTION;
PRAGMA EXCEPTION_INIT(e_constraint_violation, -2292);
BEGIN
DBMS_OUTPUT.PUT_LINE('Inner block message');
END;
EXCEPTION
WHEN e_constraint_violation THEN
DBMS_OUTPUT.PUT_LINE('Outer block message');
END; Mark for Review
(1) Points
Inner block message' will be displayed.
The code will fail because the exception
is declared in the inner block but is referenced in the outer block. (*)
Outer block message' will be displayed.
The code will fail because line 4 should
read: PRAGMA EXCEPTION_INIT(-2292, e_constraint_violation);
Correct
<<outer>>
DECLARE
v_name VARCHAR2(10) := 'Smith';
BEGIN
DECLARE
v_name VARCHAR2(10) := 'Jones';
BEGIN
DBMS_OUTPUT.PUT_LINE(<<outer>>.v_name);
END;
END;
<<outer>>
DECLARE
v_name VARCHAR2(10) := 'Smith';
BEGIN
DECLARE
v_name VARCHAR2(10) := 'Jones';
BEGIN
DBMS_OUTPUT.PUT_LINE(outer.v_name);
END;
END;
(*)
<<outer>>
DECLARE
v_name VARCHAR2(10) := 'Smith';
BEGIN
<<inner>>
DECLARE
v_name VARCHAR2(10) := 'Jones';
BEGIN
DBMS_OUTPUT.PUT_LINE(v_name);
END;
END;
Correct
Correct
Correct
Message 1
Message 2
Message 1
Message 3
Message 4
Message 1
Message 4
(*)
Correct
21. Which of the following is NOT correct coding for a procedure parameter?
Mark for Review
(1) Points
(p_param IN VARCHAR2)
(p_param VARCHAR2)
(p_param VARCHAR2(50)) (*)
(p_param employees.last_name%TYPE)
(p_param IN OUT VARCHAR2)
Correct
Correct
Correct
Correct
Correct
Correct
Correct
Correct
31. A PL/SQL procedure named MYPROC has already been created and stored in t
he database. Which of the following will successfully re-create the procedure af
ter some changes have been made to the code? Mark for Review
(1) Points
CREATE PROCEDURE myproc IS ...
CREATE OR REPLACE PROCEDURE myproc IS ..
.. (*)
UPDATE PROCEDURE myproc IS ...
ALTER PROCEDURE myproc IS ...
None of the above, because the procedure
must be dropped before it can be re-created.
Correct
EXECUTE my_proc1;
BEGIN
my_proc1;
END;
(*)
CREATE OR REPLACE PROCEDURE my_proc2 IS
BEGIN
my_proc1;
END my_proc2;
(*)
SELECT my_proc1 FROM DUAL;
33. What are the type of parameter modes? Mark for Review
(1) Points
CHARACTER, NUMBER, DATE, BOOLEAN
CONSTANT, VARIABLE, DEFAULT
LOCAL, GLOBAL, BOTH
IN, OUT, IN OUT (*)
Correct
34. Procedure SOMEPROC has five parameters named A, B, C, D,
E in that order. The procedure was called as follows:
SOMEPROC(10,20,D=>50);
How was parameter B referenced? Mark for Review
(1) Points
Positional (*)
Named
A combination of positionally and named
A combination of named and defaulted
Defaulted
Correct
Correct
Correct
Section 8
37. You have created a function named IS_LEAPYEAR that accep
ts one IN parameter of datatype DATE and returns a Boolean value (TRUE or FALSE)
depending on whether the date is in a leap year. What is wrong with this query:
Correct
Correct
41. You try to create a function named MYFUNC. The function does not compile
correctly because there are errors in your code. Which Dictionary view can you
query to see the errors? Mark for Review
(1) Points
USER_SOURCE
USER_ERRORS (*)
USER_OBJECTS
USER_DEPENDENCIES
USER_COMPILES
Correct
DECLARE
x NUMBER;
BEGIN
x:= add_em(4,5);
END;
DECLARE
x NUMBER;
BEGIN
x:= add_em;
END;
Correct
Correct
47. You want to see the names, modes and data types of the f
ormal parameters of function MY_FUNC in your schema. How can you do this? (Choos
e two) Mark for Review
(1) Points
(Choose all correct answers)
Query USER_PARAMETERS
Query USER_SOURCE (*)
Query USER_FUNCTIONS
SHOW PARAMETER my_funct;
DESCRIBE my_funct; (*)
Correct
Correct