1Z0-146 | A Review Of Approved 1Z0-146 braindumps


Q1. View the Exhibit and examine the code in the PL/SQL block. 

The PL/SQL block generates an error on execution. What is the reason? 

A. The DELETE(n) method cannot be used with varrays. 

B. The DELETE(n) method cannot be used with nested tables. 

C. The NEXT method cannot be used with an associative array with VARCHAR2 key values. 

D. The NEXT method cannot be used with a nested table from which an element has been deleted. 

Answer:

Q2. In a user session, tracing is enabled as follows: SQL> EXECUTE DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ENABLED_LINES); PL/SQL procedure successfully completed. 

You executed the procedure as follows: 

SQL> EXECUTE PROC10 

PL/SQL procedure successfully completed. 

When you examine the PLSQL_TRACE_EVENTS table, you find that no trace information was written into it. 

View the Exhibit. 

What is the reason for this? 

A. The PROC10 procedure is created with the invoker's right. 

B. The PROC10 procedure is not compiled with the DEBUG option. 

C. Tracing is not enabled with the TRACE_ENABLED_CALLS option. 

D. The TRACE_ENABLED parameter is set to FALSE for the session. 

Answer:

Q3. You created an application context successfully. The user OE was granted the EXECUTE privilege on the DBMS_SESSION package. The user receives this error while setting the value for an attribute within the context: SQL> EXECUTE DBMS_SESSION.SET_CONTEXT('SALES_ORDERS_CTX','ACCOUNT_MGR','OE'); BEGIN DBMS_SESSION.SET_CONTEXT('SALES_ORDERS_CTX','ACCOUNT_MGR','OE'); END; * ERROR at line 1: ORA-01031: insufficient privileges ORA-06512: at "SYS.DBMS_SESSION", line 94 

ORA-06512: at line 1 

What is the reason for this error? 

A. The context was created with a package name in the USING clause. 

B. The attribute can be set only in the package associated with the context. 

C. The package associated with the context did not exist at the time of creation of the context. 

D. The value for an attribute of a user-defined context can be set only by the ALTER SESSION command. 

Answer:

Q4. View the Exhibit and examine the structure of the EMPLOYEES table. 

Examine the following PL/SQL block: 

DECLARE 

TYPE EmpList 

IS VARRAY(2) OF employees.employee_id%TYPE NOT NULL; 

v_employees EmpList := EmpList(); BEGIN 

DBMS_OUTPUT.PUT_LINE(v_employees.COUNT); 

v_employees.EXTEND; 

v_employees(1) := 30; 

END; 

Which statement is true about the outcome on executing the above PL/SQL block? 

A. It executes successfully and displays the value 2. 

B. It executes successfully and displays the value 0. 

C. It generates an error because EXTEND cannot be used for varrays. 

D. It generates an error because the declaration of the varray is not valid. 

Answer:

Q5. Which two statements are true about nested tables and varrays? (Choose two.) 

A. Only varrays must have consecutive numbers as subscripts. 

B. Only nested tables can be used as column types in database tables. 

C. Both nested tables and varrays must have consecutive numbers as subscripts. 

D. Both nested tables and varrays can be used as column types in database tables. 

Answer: A,D 

Q6. Which two statements are true about the inlining of PL/SQL subprograms? (Choose two.) 

A. Only local subroutines can be inlined. 

B. Inlining always reduces the execution time for a PL/SQL program unit. 

C. PLSQL_OPTIMIZE_LEVEL must be set to a value greater than or equal to 2. 

D. The PL/SQL programs that make use of relatively large helper subroutines are good candidates for inlining. 

Answer: A,C 

Q7. Examine the structure of the DEPARTMENTS table. 

Name Null? Type 

DEPARTMENT_ID NOT NULL NUMBER(4) 

DEPARTMENT_NAME NOT NULL VARCHAR2(30) 

LOCATION_ID NUMBER(4) 

View the Exhibit and examine the code that you plan to use for creating a package to obtain the 

details of an employee using a host variable on the client side. 

In SQL*Plus, you plan to use the following commands: 

SQL> VARIABLE x REFCURSOR 

SQL> EXECUTE emp_data.get_emp(195,:x) 

SQL> PRINT x 

Which statement is true about the above scenario? 

A. The package executes successfully and passes the required data to the host variable. 

B. The package specification gives an error on compilation because cursor variable types cannot be defined in the specification. 

C. The package specification gives an error on compilation because the cursor variable parameter was specified before you defined it. 

D. The package executes successfully, but does not pass the required data to the host variable because the cursor is closed before the PRINT statement runs. 

Answer:

Q8. View the Exhibit and examine the structures of the EMPLOYEES and DEPARTMENTS tables. 

Examine the PL/SQL block that you execute to find the average salary for employees in the 

'Sales' department: 

DECLARE 

TYPE emp_sal IS TABLE OF employees.salary%TYPE INDEX BY VARCHAR2(20); 

v_emp_sal emp_sal; 

PROCEDURE get_sal(p_dept_name VARCHAR2, p_arr OUT emp_sal) IS 

BEGIN 

SELECT AVG(salary) INTO p_arr(p_dept_name) 

FROM employees WHERE department_id= 

(SELECT department_id FROM departments 

WHERE department_name=p_dept_name); 

END get_sal; BEGIN 

get_sal('Sales',v_emp_sal); 

DBMS_OUTPUT.PUT_LINE( v_emp_sal('Sales')); 

END; 

What is the outcome? 

A. It executes successfully and gives the correct output. 

B. It generates an error because the associative array definition is not valid. 

C. It generates an error because an associative array cannot be passed to a procedure in OUT mode. 

D. It generates an error because an associative array cannot be used with the SELECT INTO statement. 

Answer:

Q9. View the Exhibit and examine the settings for the PLSQL_CODE_TYPE parameter. 

After sometime, the user recompiles the procedure DISPLAY_SAL_INFO by issuing the following command: 

SQL> ALTER PROCEDURE display_sal_info COMPILE; 

Which statement would be true in this scenario? 

A. The procedure would be invalidated. 

B. The procedure would remain as NATIVE code type. 

C. The procedure would be changed to INTERPRETED code type. 

D. The command would produce an error and the procedure must be compiled using the PLSQL_CODE_TYPE attribute with value INTERPRETED. 

Answer:

Q10. Identify two methods for immunizing PL/SQL code against SQL injection attacks. (Choose two.) 

A. Use bind arguments. 

B. Validate all input concatenated to dynamic SQL. 

C. Use dynamic SQLs constructed using concatenation of input values. 

D. Use subprograms as part of packages instead of stand-alone subprograms. 

Answer: A,B