1z0-148
Free trial
Verified
Question 1
The STUDENTS table exists in your schema.
Examine the DECLARE section of a PL/SQL block:
Which two blocks are valid?
- A: BEGIN OPEN cursor3 FOR SELECT * FROM students; cursor1 :=cursor3; END;
- B: BEGIN OPEN stcur; cursor1 :=stcur; END;
- C: BEGIN OPEN cursor1 FOR SELECT * FROM students; stcur :=cursor1; END;
- D: BEGIN OPEN stcur; cursor3 :=stcur; END;
- E: BEGIN OPEN cursor1 FOR SELECT * FROM students; cursor2 :=cursor1;
Question 2
Which codes executes successfully?
- A: CREATE PACKAGE pkg AS TYPE rec_typ IS RECORD (price NUMBER, inc_pct NUMBER); PROCEDURE calc_price (price_rec IN OUT rec_typ); END pkg; / CREATE PACAKGE BODY pkg AS PROCEDURE calc_price (price_rec IN OUT rec_typ) AS BEGIN price_rec.price := price_rec.price + (price_rec.price * price_rec.inc_pct)/100; END calc_price; END pkg; / DECLARE 1_rec pkg. rec_typ; BEGIN 1_rec_price :=100; 1_rec.inc_pct :=50; EXECUTE IMMEDIATE BEGIN pkg. calc_price (:rec); END; USING IN OUT 1_rec; END;
- B: CREATE PACKAGE pkg AS TYPE rec_typ IS RECORD (price NUMBER, inc_pct NUMBER); END pkg; / CREATE PROCEDURE calc_price (price_rec IN OUT pkg. rec_typ) AS BEGIN price_rec.price := price_rec.price + (price_rec.price * price_rec.inc_pct)/100; END / DECLARE 1_rec pkg.rec_typ; BEGIN EXECUTE IMMEDIATE BEGIN calc_price (:rec); END; USING IN OUT 1_rec (100, 50); END;
- C: CREATE PACKAGE pkg AS TYPE rec_typ IS RECORD (price NUMBER, inc_pct NUMBER); END pkg; / CREATE PROCEDURE calc_price (price_rec IN OUT pkg. rec_typ) AS BEGIN price_rec.price := price_rec.price + (price_rec.price * price_rec.inc_pct)/100; END ; / DECLARE 1_rec pkg. rec_typ; BEGIN 1_rec_price :=100; 1_rec.inc_pct :=50; EXECUTE IMMEDIATE BEGIN calc_price (1_rec); END;; END;
- D: DECLARE TYPE rec_typ IS RECORD (price NUMBER, inc_pct NUMBER); 1_rec rec-typ; PROCEDURE calc_price (price_rec IN OUT rec_typ) AS BEGIN price_rec.price := price-rec.price+ (price_rec.price * price_rec.inc_pct)/100; END; BEGIN 1_rec_price :=100; 1_rec.inc_pct :=50; EXECUTE IMMEDIATE BEGIN calc_price (:rec); END; USING IN OUT 1_rec;
Question 3
Examine this function header:
FUNCTION calc_new_sal (emp_id NUMBER) RETURN NUMBER;
You want to ensure that whenever this PL/SQL function is invoked with the same parameter value across active sessions, the result is not recomputed.
If a DML statement is modifying a table which this function depends upon, the function result must be recomputed at that point in time for all sessions calling this function.
Which two actions should you perform?
- A: Ensure RESULT_CACHE_MAX_SIZE is greater than 0.
- B: Enable the result cache by using DBMS_RESULT_CACHE.BYPASS (FALSE).
- C: Add the deterministic clause to the function definition.
- D: Add the RELIES_ON clause to the function definition.
- E: Add the RESULT_CACHE clause to the function definition.
Question 4
Examine this block:
Which two will be correct after line 5?
- A: va. LAST and va. LIMIT will return the same value.
- B: va. LAST and va. COUNT will return the same value.
- C: va. LIMIT and va. COUNT will return the same value.
- D: va. LIMIT and va. NEXT (199) will return the same value.
- E: va. LAST will return 200.
- F: va. NEXT (199) will return NULL.
Question 5
Examine this code:
You want to display the contents of CREATE_LIST.
Which two lines need to be corrected in the PL/SQL block?
- A: Line 2
- B: Line 3
- C: Line 5
- D: Line 6
- E: Line 7
Question 6
Examine the following SQL statement:
ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL=3;
What is the result of executing this statements?
- A: The PL/SQL optimize level for some existing PL/SQL units will be changed as an immediate result.
- B: The PL/SQL optimize level for subsequently complied PL/SQL units will be set to 3 and inlining will be enabled.
- C: The PL/SQL optimize level for subsequently compiled PL/SQL units will be set to 3 and inlining will be disabled.
- D: This statement will fail because PLSQL_OPTIMIZE_LEVEL can only be set at the system level,
Question 7
Which two statements describe actions developers can take to make their application less vulnerable to security attacks?
- A: Include the AUTHID DEFINER clause in stored program units.
- B: Do not concatenate unchecked user input into dynamically constructed SQL statements.
- C: Switch from using DBMS_SQL to EXECUTE IMMEDIATE.
- D: Include the AUTHID CURRENT_USER clause in stored program units.
- E: Increase the amount of code that is accessible to users by default.
Question 8
Examine this code:
What is the correct statement to get the value of attribute ACCOUNT_MGR after the procedure has been executed?
- A: SELECT USERENV (‘ACCOUNT_MGR’) FROM dual;
- B: SELECT SYS_CONTEXT (‘USERENV’, ‘ACCOUNT_MGR’) FROM dual;
- C: SELECT SYS_CONTEXT (‘ORDER_CTX’, ‘ACCOUNT_MGR’) FROM dual;
- D: SELECT SYS_CONTEXT (‘ACCOUNT_MGR’, ‘ORDER_CTX’) FROM dual;
- E: SELECT USERENV (‘ORDER_CTX’) FROM dual;
Question 9
Examine this code:
Examine this DML statement executed in the SCOTT schema:
UPDATE emp SET comm = 1000 WHERE deptno= 20;
What is the outcome after executing this statement?
- A: COMM is set to 1000 for all records in the EMP table where DEPTNO = 30.
- B: The statement executes successfully but no rows are updated.
- C: COMM is set to 1000 for all records in the EMP table where DEPTNO=20.
- D: The statement fails with error ORA-28115: policy with check option violation.
Question 10
Identify the two correct scenarios where a function can be optimized using the function result cache feature.
- A: A function which inserts multiple records into a DEPARTMENTS table as part of one-time data setup for an HR application.
- B: A function which accesses multiple tables and calculates the commission to be given to a sales representative based on the number of products sold by that representative.
- C: A function which deletes all the records from an EMPLOYEES_AUDIT table based on their LOG_DATE.
- D: A function which updates the SALARY of all the employees in an EMPLOYEES table by a fixed percentage based on their DESIGNATION.
- E: A function which calculates the factorial of a given number without accessing any table.
Question 11
Examine the code:
Which two subprograms will be created successfully?
- A: CREATE FUNCTION p4 (y pkg.tab_typ) RETURN pkg.tab_typ IS BEGIN EXECUTE IMMEDIATE SELECT pdt_id, pdt_name FROM TABLE (:b) BULT COLLECT INTO pkg.x USING y; RETURN pkg.x; END p4;
- B: CREATE PROCEDURE p1 (y IN OUT pkg.tab_typ) IS BEGIN EXECUTE IMMEDIATE SELECT f (:b) FROM DUAL INTO y USING pkg.x; END p1;
- C: CREATE PROCEDURE p2 (v IN OUT VARCHAR2) IS BEGIN EXECUTE IMMEDIATE SELECT f (:b) FROM DUAL INTO v USING pkg.x; END p2;
- D: CREATE FUNCTION p3 RETURN pkg. tab_typ IS BEGIN EXECUTE IMMEDIATE SELECT f (:b) FROM DUAL INTO pkg.x; END p3;
- E: CREATE PROCEDURE p5 (y pkg. rec_typ) IS BEGIN EXECUTE IMMEDIATE SELECT pdt_name FROM TABLE (:b) BULK COLLECT INTO y USING pkg.x;
Question 12
Select the correct statement regarding BEQUEATH CURRENT_USER.
- A: If a view references a PL/SQL function then BEQUEATH CURRENT_USER allows the function to execute with DBA privileges, regardless of the invoking users privileges.
- B: The BEQUEATH CURRENT_USER clause allows invoker’s rights functions referenced in a view to execute with the privileges of the invoking user.
- C: Any view calling a PL/SQL function with BEQUEATH CURRENT_USER in effect will execute with the privileges of the function owner.
- D: With the BEQUEATH CURRENT_USER clause, a definer’s rights function referenced in a view executes with the privileges of the view owner, not the function
Question 13
Which tablespace is used to store the data collected by PL/Scope?
- A: UNDOTBS1
- B: SYSAUX
- C: SYSTEM
- D: TEMP
- E: USERS
Question 14
Which must be true in order to add RESULT_CACHE to a function header and have it compile successfully?
- A: The IN parameters must not include BLOB, CLOB, collection or record data types.
- B: The function must be created with invoker’s rights or in an anonymous block.
- C: The function must be declared as a pipelined table function.
- D: The function must have an OUT or an IN OUT parameter.
Question 15
Which two statements are true with respect to fine-grained access control?
- A: It is implemented by end users.
- B: It can be used to implement column masking.
- C: It implements security rules through functions and associates these security rules with tables, views or synonyms.
- D: Separate policies are required for queries versus INSERT/UPDATE/DELETE statements.
- E: The DBMS_FGA package is used to set up fine-grained access control.
That’s the end of your free questions
You’ve reached the preview limit for 1z0-148Consider upgrading to gain full access!
Free preview mode
Enjoy the free questions and consider upgrading to gain full access!