Escolar Documentos
Profissional Documentos
Cultura Documentos
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 1
(Answer all questions in this section)
1. Which of the following are characteristics of anonymous PL/SQL blocks but not PL/SQL
subprograms? (Choose three.) Mark for Review
(1) Points
(Choose all correct answers)
Can take parameters
Correct
REPLACE
EXCEPTION
DECLARE
END (*)
Correct
3. PL/SQL subprograms, unlike anonymous blocks, are compiled each time they are
executed. True or False? Mark for Review
(1) Points
True
False (*)
Correct
4. Which of the following are benefits of using PL/SQL subprograms rather than
anonymous blocks? (Choose three.) Mark for Review
(1) Points
(Choose all correct answers)
Better data security (*)
Stored externally
Correct
False
Correct
6. The following are the steps involved in creating, and later modifying and re-creating, a
PL/SQL procedure in Application Express. Which step is missing? Mark for Review
(1) Points
1. Type the procedure code in the SQL Commands window
2. Click on the "Save" button and save the procedure code
3. Retrieve the saved code from "Saved SQL" in SQL Commands
4. Modify the code in the SQL Commands window
5. Execute the code to re-create the procedure
Correct
False (*)
Correct
An action (*)
A return of values
Correct
9. When modifying procedure code, the procedure code statement must be re-executed
to validate and store it in the database. True or False? Mark for Review
(1) Points
True
False (*)
Correct
10. A programmer wants to create a PL/SQL procedure named MY_PROC. What will
happen when the following code is executed? Mark for Review
(1) Points
CREATE OR REPLACE PROCEDURE my_proc IS
v_empid employees.empid%TYPE;
BEGIN
SELECT employee_id INTO v_empid FROM employees
WHERE region_id = 999;
DBMS_OUTPUT.PUT_LINE('The salary is: ' || v_salary);
The statement will raise a NO_DATA_FOUND exception because region_id 999
does not exist.
The statement will fail because the last line of code should be END my_proc; (*)
The statement will fail because you cannot declare variables such as v_empid
inside a procedure.
Correct
11. A nested subprogram can be called from the main procedure or from the calling
environment. True or False? Mark for Review
(1) Points
True
False (*)
Correct
Correct
13. A stored PL/SQL procedure can be invoked from which of the following?
Mark for Review
(1) Points
1. A PL/SQL anonymous block
2. A calling application
3. A SELECT statement
4. Another PL/SQL procedure
A only
A and B
A and C
A, B and D (*)
B and C
Correct
Section 1
(Answer all questions in this section)
1. A procedure has been created as:
Mark for Review
CREATE PROCEDURE myproc (1) Points
(p_left NUMBER, p_right NUMBER)
IS BEGIN ....
You want to call the procedure from an anonymous block. Which of the following calls is
valid?
myproc(p_left, p_right);
myproc(v_left, v_right);
myproc(v_left, 30);
A literal value.
An expression.
Correct
3. What is the correct syntax to create procedure MYPROC that accepts two number
parameters X and Y? Mark for Review
(1) Points
CREATE PROCEDURE myproc (x NUMBER, y NUMBER) IS ... (*)
Correct
They allow values to be passed between the calling environment and the
procedure. (*)
They count the number of exceptions raised by the procedure.
Correct
5. Which of the following best describes the difference between a parameter and an
argument? Mark for Review
(1) Points
They are both names of variables. A parameter is passed into the procedure, while
an argument is passed out of the procedure
A parameter is the name of a variable, while an argument is the datatype of that
variable
A parameter is the name of a variable that is passed into or out of a procedure,
while an argument is the value of that variable (*)
There is no difference, parameters and arguments are the same thing
Correct
Section 1
(Answer all questions in this section)
1. Three IN parameters for procedure ADD_EMPLOYEE are defined as:
(p_name VARCHAR2 , Mark for Review
p_salary NUMBER := 1000, (1) Points
p_hired DATE DEFAULT SYSDATE)
add_employee('Jones');
The procedure will not compile because P_SALARY should have been coded as
DEFAULT 1000
The call will fail because P_SALARY is a required parameter
Correct
2. When creating a procedure, where in the code must the parameters be listed?
Mark for Review
(1) Points
After the procedure name. (*)
Correct
Named
Correct
You want to call the procedure, passing arguments of 10 for X and 20 for Z. Which
one of the following calls is correct?
numproc(10,,20);
numproc(x=10,z=20);
numproc(10,z=>20); (*)
numproc(x=>10,20);
Correct
5. Which of the following statements about IN OUT parameters is true? (Choose two.)
Mark for Review
(1) Points
(Choose all correct answers)
The data type for the parameter must be VARCHAR2.
The parameter value passed into the subprogram is always returned unchanged
to the calling environment.
The parameter value can be returned as the original unchanged value. (*)
The parameter value can be returned as a new value that is set within the
procedure. (*)
Correct
Named
Correct
Correct
The phone number 800.555.1234 is placed into the p_phone_no variable. (*)
The procedure does not execute because the input variable is not properly
declared.
Correct
9. If you don't specify a mode for a parameter, what is the default mode?
Mark for Review
(1) Points
OUT
IN (*)
COPY
DEFAULT
R(ead)
Correct
IN
CONSTANT
R(ead)
W(rite)
Correct
Which one of the following calls to the procedure will NOT work?
myproc(80, 'Smith');
Correct