Oracle 1Z0-149 Oracle Database 19c: Program with PL/SQL QUESTION & ANSWERS https://www.genuinedumps.com/1Z0-149-exam-questions.html QUESTION 1 Which of the following statements is true about implicit cursors? A. B. C. D. Implicit cursors are used for SQL statements that are not named. Developers should use implicit cursors with great care. Implicit cursors are used in cursor for loops to handle data processing. Implicit cursors are no longer a feature in Oracle. Correct Answer: A QUESTION 2 Which of the following are the features of PL/SQL? A. B. C. D. It offers extensive error checking It offers numerous data types. It offers a variety of programming structures. All of the mentioned Correct Answer: D QUESTION 3 Select the invalid variable type A. B. C. D. E. CHAR VARCHAR1 VARCHAR2 INTEGER NUMBER Correct Answer: B QUESTION 4 Which of the following is not true about large object data types and in PL/SQL? https://www.genuinedumps.com/1Z0-149-exam-questions.html A. B. C. D. BFILE is used to store large binary objects in operating system files outside the database. BLOB is used to store character data in the database. CLOB is used to store large blocks of character data in the database. NCLOB is used to store large blocks of NCHAR data in the database. Correct Answer: B Explanation/Reference: A BLOB (binary large object) is a varying-length binary string that can be up to 2,147,483,647 characters long. Like other binary types, BLOB strings are not associated with a code page. In addition, BLOB strings do not hold character data. https://docs.oracle.com/javadb/10.8.3.0/ref/rrefblob.html QUESTION 5 Examine the following PL/SQL code: Which statement is true about the execution of the PL/SQL code? A. B. C. D. It executes successfully. It generates a run-time exception. It does not execute because of syntax error It executes successfully and generates a warning. Correct Answer: B Explanation/Reference: ERROR at line 1: ORA-01476: divisor is equal to zero ORA-06512: at line 6 http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/errors.htm https://www.genuinedumps.com/1Z0-149-exam-questions.html QUESTION 6 Which two can be used to find details of parameters for overloaded PL/SQL routines? A. B. C. D. E. ALL-DEPENDENCIES ALL_PROCEDURES ALL_DESCRIBE ALL_SOURCE ALL_ARGUMENTS Correct Answer: B,E QUESTION 7 View the Exhibit to examine the PL/SQL block. Which statement is true about the execution of the PL/SQL block? A. It executes successfully and gives the desired output. B. It does not execute because the definition of type population is indexed by VARCHAR2. C. It executes, and the string keys of an associative array are not stored in creation order, but in sorted order. D. It does not execute because the value that is once assigned to the element of the associative array cannot be changed. Correct Answer: C https://www.genuinedumps.com/1Z0-149-exam-questions.html Explanation/Reference: http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#LNPLS005 QUESTION 8 What is the maximum number of exception handlers processed before the PL/SQL block is exited, provided an exception occurs? Please select the best answer. A. B. C. D. None All exceptions that are referenced in the block One All exceptions that apply Correct Answer: C QUESTION 9 Which of the following is not a feature of a cursor FOR loop? https://www.genuinedumps.com/1Z0-149-exam-questions.html A. B. C. D. Record type declaration. Opening and parsing of SQL statements. Fetches records from cursor. Requires exit condition to be defined. Correct Answer: B QUESTION 10 You are logged on to the SCOTT schema and the schema has EMP and DEPT tables already created: Examine this PL/SQL procedure: Which PL/SQL block will raise an exception? A. B. C. D. E. EXEC get_tab_row_count (‘emp’); EXEC get_tab_row_count (‘SCOTT.EMP’); EXEC get_tab_row_count (‘ "EMP" ’); EXEC get_tab_row_count (‘DEPT’); EXEC get_tab_row_count (‘DEPT, EMP’) Correct Answer: E QUESTION 11 What does a COMMIT statement do to a CURSOR? A. B. C. D. Open the Cursor Fetch the Cursor Close the Cursor None of the above https://www.genuinedumps.com/1Z0-149-exam-questions.html Correct Answer: D QUESTION 12 Examine this code: Which two corrections must be applied for this anonymous block to execute successfully? A. B. C. D. E. F. Change RETURN p_tab.LAST to RETURN p_tab.COUNT. Declare the collection type inside the function. Declare the collection type at the schema level instead of the package. Define the function as stand-alone instead of in a package body. Change the INDEX BY clause from VARCHAR2 to PLS_INTEGER. Modify the function return type to return a scalar, VARCHAR2. Correct Answer: E,F QUESTION 13 With SERVEROUTPUT enabled, you successfully create the package YEARLY_LIST: https://www.genuinedumps.com/1Z0-149-exam-questions.html You want to display the contents of CREATE_LIST. Which two lines need to be corrected in the PL/SQL block? A. B. C. D. E. Line 2 Line 3 Line 5 Line 6 Line 7 Correct Answer: A,E Explanation/Reference: Line 2 is wrong because new variable requires type for itself. Line 7 is wrong since collection attribute next requires as input parameter the index of existing element from which we want to find next one like this array.next(curr_index) https://www.genuinedumps.com/1Z0-149-exam-questions.html QUESTION 14 Which two statements are true about triggers? (Choose two.) A. All the triggers that are created on a table cannot be disabled simultaneously. B. Any user who has the alter privilege on a table can create a trigger using that table. C. Oracle provides a two-phase commit process whether a trigger updates tables in the local database or remote tables in a distributed database. D. Triggers become invalid if a dependent object, such as 3 stored subprogram that is invoked from the trigger body is modified, and have to be manually recompiled before the next invocation. Correct Answer: B,D Explanation/Reference: Not A: https://docs.oracle.com/cd/B28359_01/server.111/b28310/general004.htm#ADMIN11534 Not C: https://docs.oracle.com/cd/B28359_01/server.111/b28318/triggers.htm#CNCPT1681 QUESTION 15 This result cache is enabled for the database instance. Examine this code for a PL/SQL function: Which two actions would ensure that the same result will be consistently returned for any session when the same input value is passed to the function? A. B. C. D. Add a parameter, fmt, and change the RETURN statement to: RETURN TO_CHAR (date_hired, fmt); Set the RESULT_CACHE_MODE parameter to FORCE. Increase the value for the RESULT_CACHE_MAX_SIZE parameter. Change the return type of GET_HIRE_DATE to DATE and have each session invoke the TO_CHAR function. E. Set the RESULT_CACHE_MAX_RESULT parameter to 0. https://www.genuinedumps.com/1Z0-149-exam-questions.html Correct Answer: D QUESTION 16 What does %FOUND attribute indicate? A. B. C. D. It indicates that the cursor was found. It indicates that the number of rows that got affected. It indicates whether any rows were affected. It indicates whether any rows were not affected. Correct Answer: C QUESTION 17 Examine these statements: Which two corrections will allow this anonymous block to execute successfully? A. B. C. D. E. Add wk# .NEXT; before the 7 line. rd Add i PLS_INTEGER; before the 3 line. Add wk#. EXTEND (1); before the 5 th line. Change line #2 to wk# tp_test# := tp_test# (tp_rec# ()); Replace lines 5 and 6 with wk# (i) := tp_rec# (i, i); Correct Answer: C,E https://www.genuinedumps.com/1Z0-149-exam-questions.html QUESTION 18 Examine this code: What will be the outcome? A. B. C. D. It will execute successfully and will display the user-defined error message. It will result in an error as the range of the error code can only be from “-20000 to -20999.” It will result in an error as the range of the error code can only be from “-1000 to -2000.” It will result in an error as the range of the error code can only be from “-2000 to -2999." Correct Answer: B QUESTION 19 Assuming the date and time is 09/09/2009 09:09:09, what value will the following statement return SELECT TO_CHAR(TRUNC(SYSDATE),'MM/DD/YYYY HH24:MI:SS') FROM dual; A. B. C. D. E. 09/09/2009 09:09:09 09/09/2009 09:09:09AM 09/09/2009 09/09/2009 00:00:00 None of the above Correct Answer: D Explanation/Reference: Time will be truncated and then added due to the format as 00:00:00. QUESTION 20 Examine this code: CREATE FUNCTION emp_policy_fn(v_schema IN VARCHAR2, v_objname IN VARCHAR2) AS con VARCHAR2(200); BEGIN con := ‘deptno = 30’; RETURN con; END emp_policy_fn; / https://www.genuinedumps.com/1Z0-149-exam-questions.html BEGIN DBMS_RLS.ADD_POLICY( object_schema => ‘scott’, object_name => ‘emp’, policy_name => ‘emp_policy’, policy_function => ‘emp_policy_fn’, update_check => TRUE, statement_types => ‘SELECT, UPDATE’, sec_relevant_cols => ‘sal, comm’); END; / 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. B. C. D. COMM is set to 1000 for all records in the EMP table where DEPTNO = 30. The statement executes successfully but no rows are updated. COMM is set to 1000 for all records in the EMP table where DEPTNO=20. The statement fails with error ORA-28115: policy with check option violation. Correct Answer: B Explanation/Reference: Function return is added to a where clausu and there is no update at all. https://docs.oracle.com/database/121/ARPLS/d_rls.htm#ARPLS67714 QUESTION 21 What is the value of %ROWCOUNT before the first row is fetched? A. B. C. D. 1 Zero -1 NULL Correct Answer: B QUESTION 22 Examine this table in the SH schema: https://www.genuinedumps.com/1Z0-149-exam-questions.html User SH executes this code: The program must terminate with a user-defined message and no rows displayed if more than one product's price is 1000. With which option must “---placeholder” be replaced? A. B. C. D. https://www.genuinedumps.com/1Z0-149-exam-questions.html E. Correct Answer: A QUESTION 23 Which three are true about the NOCOPY hint, the PARALLEL ENABLE hint, and the DETERMINISTIC clause? (Choose three.) A. B. C. D. E. The PARALLEL_ENABLE clause can be used only in the CREATE FUNCTION statement. The NOCOPY hint asks the compiler to pass the actual parameters by reference. A deterministic function's results always depend on the state of session variables. The NOCOPY hint asks the compiler to pass the actual parameters by value. A function is deterministic if it always returns the same result for a specific combination of input values. F. The PARALLEL_ENABLE clause can be specified for a nested function. G. A function defined with the PARALLEL_ENABLE clause may be executed in parallel in a SELECT statement or a subquery in a DML statement. Correct Answer: B,E,G QUESTION 24 How to disable all triggers on EMP Table? A. B. C. D. ALTER TABLE EMP DISABLE TRIGGERS ALL; ALTER TABLE EMP DISABLE ALL TRIGGERS; DISABLE TRIGGERS; DISABLE TRIGGERS ON EMP; Correct Answer: B QUESTION 25 You execute the following block of code: https://www.genuinedumps.com/1Z0-149-exam-questions.html Which statement is true about the outcome? A. B. C. D. Both Output statements show different values. Both output statements show exactly the same values. It gives an error because the nested blocks are not labeled. It gives an error because the V_CUSTOMER variable have different types in the nested blocks Correct Answer: A QUESTION 26 View the Exhibit and examine the structure of the AUDIR_CUST table. CUST_ID and CUST_LIMIT are existing columns in the CUSTOMER table. Examine the following trigger code: https://www.genuinedumps.com/1Z0-149-exam-questions.html Which statement is true about the above trigger? A. B. C. D. It gives an error on compilation because it should be a statement-level trigger. It compiles and fires successfully when the credit limit is updated in the customer table. It gives an error on compilation because of the commit command in the trigger code It compiles successfully, but gives an error when the credit limit is updated in the CUSTOMER table because the PRAGMA AUTONOMOUS_TRANSACTION statement should be introduced in the trigger. Correct Answer: D Explanation/Reference: https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:486421585357 You cannot commit in a trigger (until Oracle8i release 8.1 with autonomous transactions -- these will NOT commit the "parent" statement but only allow you to create a small subtransaction that is standalone and independently commited. QUESTION 27 View Exhibit and examine the structure of the EMP table. Examine the code created by the user SCOTT: https://www.genuinedumps.com/1Z0-149-exam-questions.html SCOTT grants the necessary privileges to GREEN to access the EMP table and execute the package. Examine the following sequence of activities: SCOTT starts a session and issues the SQL>EXEC CURS_PKG.OPEN command. SCOTT then issues the SQL>EXEC CURS_PKG.NEXT command. GREEN starts a session while SCOTTs session is running and issues THE SQL>EXEC CURS_PKG.NEXT command. SCOTT issues the SQL>>EXEC SCOTT.CURS_PKG.NEXT command. The EMP table contains sequential EMPNOS from 100 through 108. Which statement correctly describes the output? A. SCOTT’s session shows the EMPNO 100, GREEN'S session shows an error, and SCOTT’s session shows an error. B. SCOTT’s session shows the EMPNO 100, GREEN'S session shows EMPNO 100, and SCOTT’s session shows the EMPNO 101. C. SCOTT’s session shows the EMPNO 100, GREEN'S session shows an error, and SCOTT’s session shows the second EMPNO 101. D. SCOTT’s session shows the EMPNO 100, GREEN'S session shows EMPNO 101, and SCOTT’s session shows the second EMPNO 102. https://www.genuinedumps.com/1Z0-149-exam-questions.html Correct Answer: C Explanation/Reference: Following error is thrown in Green’s session because cursor wasn’t opened first before getting next record. SQL> EXEC CURS_PKG.NEXT BEGIN CURS_PKG.NEXT; END; * ERROR at line 1: ORA-01001: invalid cursor ORA-06512: at “HR.CURS_PKG”, line 14 ORA-06512: at line 1 QUESTION 28 Which two statements are true about statement-level and row-level triggers? (Choose two.) A. A row trigger fires once even if no rows are affected. B. A statement trigger fires once even if no rows are affected C. Row triggers are useful if the trigger action depends on the data of rows that are affected or on data that is provided by the triggering event itself D. Statement triggers are useful if the trigger action depends on the data of rows that are affected or on data that is provided by the triggering event itself. Correct Answer: B,C Explanation/Reference: http://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqlj43125.html statement triggers A statement trigger fires once per triggering event and regardless of whether any rows are modified by the insert, update, or delete event. row triggers A row trigger fires once for each row affected by the triggering event. If no rows are affected, the trigger does not fire. QUESTION 29 Examine this external function declaration: https://www.genuinedumps.com/1Z0-149-exam-questions.html Which C function does it publish? A. OCINumber * compareAndSum (OCIExtProcContext *ctx, OCINumber *p1, OCINumber *p2, OCINumber *p3); B. OCINumber compareAndSum (OCIExtProcContext *ctx, OCINumber p1, OCINumber p2, OCINumber *p3); C. int compareAndSum (OCIExtProcContext *ctx, int p1, int p2, OCINumber *p3); D. int compareAndSum (OCIExtProcContext *ctx, int p1, int p2, OCINumber p3); E. int compareAndSum (OCIExtProcContext *ctx, int p1, int p2, int p3); F. int compareAndSum (OCIExtProcContext *ctx, int p1, int p2, int* p3); G. OCINumber compareAndSum (OCIExtProcContext *ctx, OCINumber p1, OCINumber p2, OCINumber p3); Correct Answer: C QUESTION 30 Which of the following is true about PL/SQL nested tables? A. Nested tables are like one-dimensional arrays with arbitrary number of elements. B. Unlike arrays a nested table doesn’t have declared number of elements. The size of a nested table can increase dynamically. C. Initially a nested array has consecutive subscripts or dense, but it can become sparse when elements are deleted from it. D. All of the above. Correct Answer: D QUESTION 31 Which statement is correct about DBMS_LOB.SETOPTIONS and DBMS_LOB.GETOPTIONS for SecureFiles? A. DBMS_LOB.GETOPTIONS can only be used for BLOB data types. B. DBMS_LOB.SETOPTIONS can perform operations on individual SecureFiles but not an entire column. C. DBMS_LOB.SETOPTIONS can set option types COMPRESS, DUPLICATE, and ENCRYPT. D. If a table was not created with compression specified in the store as securefile clause then DBMS_LOB.SETOPTIONS can be used to enable it later. https://www.genuinedumps.com/1Z0-149-exam-questions.html Correct Answer: C Explanation/Reference: You can turn off a feature on a particular SecureFiles LOB and turn on a feature that has been turned off by SETOPTIONS(), but you cannot turn on an option that has not been given to the SecureFiles LOB when the table was created. QUESTION 32 View the Exhibit and examine the structure of the employees table. Execute the following block of code: What is the outcome? A. It gives an error because group functions cannot be used in anonymous blocks B. It executes successfully and correctly gives the result of the sum of salaries in department 60. C. It executes successfully and incorrectly gives the result of the sum of salaries in department 60. Correct Answer: C https://www.genuinedumps.com/1Z0-149-exam-questions.html Explanation/Reference: https://docs.oracle.com/cd/E18283_01/appdev.112/e17126/nameresolution.htm In ambiguous SQL statements, the names of columns take precedence over the names of local variables and formal parameters. For example, if a variable and a column with the same name are used in a WHERE clause, SQL considers both names to refer to the column. QUESTION 33 What are overloaded subprograms? A. B. C. D. Two or more subprograms that can have the same name with different parameter lists. Two subprograms that can have different name with different parameter lists. Two or more subprograms that can have the same name with same parameter lists. Two or more subprograms that can have different name with same parameter lists. Correct Answer: A QUESTION 34 Which collection exception is raised when nonexistent element of an associative array? A. B. C. D. NO_DATA_FOUND COLLECTION_IS_NULL SUBSCRIPT_BEYOND_COUNT SUBSCRIPT_OUTSIDE_LIMIT Correct Answer: A QUESTION 35 What is SCHEMA Trigger? A. B. C. D. Created on a schema and fires whenever the user who owns it is initiates the triggering event. Created on table Created on ddl operations None of the above Correct Answer: A https://www.genuinedumps.com/1Z0-149-exam-questions.html QUESTION 36 Which of the following is not true about the Constructors? A. B. C. D. These are functions that return a new object as its value. Every object has a system defined constructor method. The name of the constructor is same as the object type. None of the above. Correct Answer: D QUESTION 37 What are exceptions in PL/SQL? A. B. C. D. Runtime errors Runtime warnings Compile time errors Compile time warnings Correct Answer: A QUESTION 38 Examine the incomplete code: https://www.genuinedumps.com/1Z0-149-exam-questions.html Which three lines of code must be added for it to successfully compile? A. B. C. D. E. F. curid := DBMS_SQL.TO_CURSOR_NUMBER (src_cur); src_cur := DBMS_SQL.TO_REFCURSOR (curid); src_cur= NUMBER; curid NUMBER; curid SYS_FEFCURSOR; src_cur SYS_REFCURSOR; Correct Answer: B,D,F https://www.genuinedumps.com/1Z0-149-exam-questions.html