Q1. View Exhibit1 and examine the structure of the EMPLOYEES table.
itexamworld.com
View Exhibit2 and examine the code in the PL/SQL block.
The PL/SQL block fails to execute. What could be the reason?
A. Nested tables cannot be returned by a function.
B. The NEWNAMES nested table has not been initialized.
C. The assignment operator cannot be used to transfer all the element values from GROUP1 to GROUP2.
D. The third element of OLDNAMES cannot be assigned to the third element of GROUP1 because they are of inconsistent data types.
E. LAST_NAME values cannot be assigned to the V_LAST_NAMES nested table because local collection types are not allowed in SQL statements.
Answer: E
Q2. When do you use static SQL as a technique for avoiding SQL injection?
A. when the WHERE clause values are unknown
B. when the code contains data definition language (DDL) statements
C. when all Oracle identifiers are known at the time of code compilation
D. when the SET clause values are unknown at the time of code compilation
Answer: C
Q3. Identify two factors that you consider for compiling a PL/SQL program unit for interpreted mode. (Choose two.)
A. a PL/SQL program which needs to be recompiled frequently
B. a PL/SQL program that spends most of the time executing SQL
C. a PL/SQL program, which performs computation-intensive procedural operations and is recompiled rarely
D. a PL/SQL program, which is called frequently with the same parameter values by multiple sessions and is recompiled rarely
Answer: A,B
Q4. The PLSQL_OPTIMIZE_LEVEL parameter is set to 2 for the session.
Examine the section of code given:
FUNCTION p2 (p boolean) return PLS_INTEGER IS ...
FUNCTION p2 (x PLS_INTEGER) return PLS_INTEGER IS
PRAGMA INLINE(p2, 'YES');
x := p2(true) + p2(3);
Which statement is true about the INLINE pragma procedure calls?
A. Only the call to the P2 function with BOOLEAN as the argument is inlined.
B. INLINE pragma affects both the functions named P2 and is called inline.
C. Only the call to the P2 function with PLS_INTEGER as the argument is inlined.
D. None of the functions are inlined because inlining is not supported for overloaded functions.
Answer: B
Q5. You created a procedure as follows:
CREATE OR REPLACE PROCEDURE query_prod(twhr VARCHAR2)
IS
stmt VARCHAR2(100);
pname VARCHAR2(20);
BEGIN
stmt:='SELECT product_name FROM products WHERE product_id=:2'
EXECUTE IMMEDIATE stmt INTO pname USING twhr;
DBMS_OUTPUT.PUT_LINE(pname);
END;
/
View the Exhibit to examine the structure of PRODUCTS table.
Which statement is true about the procedure?
A. It produces an error when invoked.
B. It can be invoked only from a PL/SQL block.
C. It reduces the chances of SQL injection by using bind arguments.
D. The values for bind arguments remain persistent in the session after the execution of the procedure.
Answer: C
Q6. View the Exhibit and examine the PL/SQL code.
Which statement is true about the execution of the PL/SQL code?
A. It executes successfully and displays 101 and 200000 values.
B. The ASSIGN_VAL function generates an error during compilation because nested tables cannot be returned by functions.
C. The SELECT statement generates an error because the nested table has not been initialized in the ASSIGN_VAL function.
D. The ASSIGN_VAL function generates an error during compilation because the EXTEND method cannot be used with nested tables.
Answer: C
Q7. Which two statements are true about associative arrays and varrays? (Choose two.)
A. Only varrays must start with the subscript 1.
B. Only varrays can be used as column types in database tables.
C. Both associative arrays and varrays must start with the subscript 1.
D. Both associative arrays and varrays can be used as column types in database tables.
Answer: A,B
Q8. Which two statements are true about the working of fine-grained access? (Choose two.)
A. Security policies can be associated only with tables, but not with views.
B. Different policies can be used for SELECT, INSERT, UPDATE, and DELETE statements.
C. User statements are dynamically modified by the Oracle server through a security policy function.
D. Fine-grained access control policies always remain in effect until they are dropped from a table or view.
Answer: B,C
Q9. Which two statements are true about the tuning of PL/SQL code? (Choose two.)
A. Redundant SQL statements in PL/SQL code should be avoided.
B. Implicit data type conversion in PL/SQL code can improve performance.
C. Usage of the NOT NULL constraint in PL/SQL code can degrade performance.
D. If you have one PL/SQL program unit instead of multiple smaller executable sections, performance can be improved.
Answer: A,C
Q10. Identify three guidelines for the DBMS_ASSERT package. (Choose three.)
A. Prefix all calls to DBMS_ASSERT with the SYS schema name.
B. Embed DBMS_ASSERT verification routines inside the injectable string.
C. Escape single quotes when you use the ENQUOTE_LITERAL procedure.
D. Define and raise exceptions explicitly to handle DBMS_ASSERT exceptions.
E. Prefix all calls to DBMS_ASSERT with a schema name that owns the subprogram that uses the DBMS_ASSERT package.
Answer: A,C,D