0% found this document useful (0 votes)
7K views

Exam2 Advanced PLSQL Programming

The document contains 40 multiple choice questions about PL/SQL concepts such as packages, procedures, functions, parameters, cursors, and exception handling. Key topics covered include defining and using packages, procedures, and functions; parameter modes and passing; explicit cursors and cursor attributes; and exception handling.

Uploaded by

meachamrob
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7K views

Exam2 Advanced PLSQL Programming

The document contains 40 multiple choice questions about PL/SQL concepts such as packages, procedures, functions, parameters, cursors, and exception handling. Key topics covered include defining and using packages, procedures, and functions; parameter modes and passing; explicit cursors and cursor attributes; and exception handling.

Uploaded by

meachamrob
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Question 1

5 out of 5 points

The code fragment below is an example of a(n) ____. CREATE OR REPLACE PACKAGE product_info_pkg IS PROCEDURE prod_search_pp (p_id IN bb_product.idproduct%TYPE, p_sale OUT bb_product.saleprice%TYPE, p_price OUT bb_product.price%TYPE); PROCEDURE prod_search_pp (p_id IN bb_product.productname%TYPE, p_sale OUT bb_product.saleprice%TYPE, p_price OUT bb_product.price%TYPE); END; Answer Selected Answer: b. overloaded procedure Correct Answer: b. overloaded procedure Question 2 5 out of 5 points

In the code below, which of the following is the parameter variable? CREATE OR REPLACE FUNCTION fct_test1_sf (p_num IN NUMBER) RETURN NUMBER IS BEGIN UPDATE bb_test1 SET col1 = p_num; RETURN p_num; END; / Answer Selected Answer: c. p_num Correct Answer: c. p_num Question 3 0 out of 5 points

The term ____ refers to the range of visibility for a particular element or construct contained in a package. Answer Selected Answer: b. package specification Correct Answer: a. package scope Question 4 5 out of 5 points

____ refer to the arguments that are used when calling or invoking the program unit. Answer Selected Answer: a. Actual parameters Correct Answer: a. Actual parameters Question 5 5 out of 5 points

Analyze the following code that invokes a package procedure. Which of the following statements is true? EXECUTE emma.hr_package.new_emp(:p_emp_id);

Answer Selected Answer: c. This codes invokes a procedure called new_emp from the package called hr_package in the emma schema. Correct Answer: c. This codes invokes a procedure called new_emp from the package called hr_package in the emma schema. Question 6 0 out of 5 points

The ____ command is used to view parameter information. Answer Selected Answer: d. OUT Correct Answer: c. DESC Question 7 5 out of 5 points

Which data dictionary can be used to display a list of functions you created in your schema? Answer Selected Answer: c. USER_OBJECTS Correct Answer: c. USER_OBJECTS Question 8 5 out of 5 points

____ refer to the parameters that are listed in the program unit. Answer Selected Answer: d. Formal parameters Correct Answer: d. Formal parameters Question 9 5 out of 5 points

The following code is an example of a(n) ____. DECLARE lv_name_txt VARCHAR2(35); lv_id_num NUMBER(4) := 25; lv_first_txt VARCHAR2(15) := 'Scott'; lv_last_txt VARCHAR2(20) := 'David'; BEGIN lv_name_txt := memfmt1_sf(lv_id_num,lv_first_txt, lv_last_txt); DBMS_OUTPUT.PUT_LINE(lv_name_txt); END; / Answer Selected Answer: d. anonymous block Correct Answer: d. anonymous block Question 10 5 out of 5 points

At least one ____ statement must be included in a function body to instruct which value to return. Answer Selected Answer: b. RETURN Correct Answer: b. RETURN Question 11 5 out of 5 points

The statement ____ would successfully remove the package specification and body.

Answer Selected Answer: c. DROP PACKAGE package_name; Correct Answer: c. DROP PACKAGE package_name; Question 12 5 out of 5 points

Functions used in SQL statements must meet all of the following requirements, except ____. Answer Selected Answer: b. Can use only OUT parameters Correct Answer: b. Can use only OUT parameters Question 13 0 out of 5 points

When creating a package body for the package specification below, which of the following statements is incorrect? CREATE OR REPLACE PACKAGE ordering_pkg IS pv_total_num NUMBER(3,2); PROCEDURE order_total_pp (p_bsktid IN NUMBER, p_sub OUT NUMBER); FUNCTION ship_calc_pf (p_qty IN NUMBER) RETURN NUMBER; END; Answer Selected Answer: d. Items declared in the body and not in the specification can be used only by other procedures and functions within this same package body. Correct Answer: c. The package body cannot include declarations of variables, cursors, types, and program units not found in the corresponding specification. Question 14 5 out of 5 points

Analyze the following code. The code fragment below is an example of a(n) ____. CREATE OR REPLACE PACKAGE ordering_pkg IS pv_total_num NUMBER(3,2); PROCEDURE order_total_pp (p_bsktid IN NUMBER, p_sub OUT NUMBER); FUNCTION ship_calc_pf (p_qty IN NUMBER) RETURN NUMBER; END; Answer Selected Answer: c. package specification Correct Answer: c. package specification Question 15 5 out of 5 points

____ a program unit or PL/SQL block of code allows the storage and reuse of the code. Answer Selected Answer: a. Naming Correct Answer: a. Naming

Question 16

5 out of 5 points

The ____ command can be used to list details about the structure of a procedure, such as information regarding the parameters. Answer Selected Answer: b. DESCRIBE Correct Answer: b. DESCRIBE Question 17 5 out of 5 points

The DBMS_OUTPUT.PUT_LINE statement can be used to ____. Answer Selected Answer: d. assist with debugging/testing your code Correct Answer: d. assist with debugging/testing your code Question 18 5 out of 5 points

To reference a host variable in PL/SQL, a preceding ____ must be used with the host variable name. Answer Selected Answer: a. colon Correct Answer: a. colon Question 19 5 out of 5 points

____ are mechanisms used to send values into and out of a program unit. Answer Selected Answer: a. Parameters Correct Answer: a. Parameters Question 20 5 out of 5 points

One important item that needs to be considered when creating stored procedures is to make them flexible so that they can be ____. Answer Selected Answer: b. reused Correct Answer: b. reused Question 21 5 out of 5 points

The ____ area of a block determines what happens if an error occurs. Answer Selected Answer: d. exception handling Correct Answer: d. exception handling Question 22 5 out of 5 points

Which three pieces of information for each parameter must be provided in a procedure header? Answer Selected Answer: a. name, mode, and datatype Correct Answer: a. name, mode, and datatype

Question 23

5 out of 5 points

The ____ command can be used to remove procedures. Answer Selected Answer: b. DROP Correct Answer: b. DROP Question 24 0 out of 5 points

A parameter with a(n) ____ only mode can receive a value, but this value cannot be changed in the procedure. Answer Selected Answer: c. OUT Correct Answer: b. IN Question 25 0 out of 5 points

If values are calculated or retrieved from the database within the procedure, ____ parameters are used to return these values to the calling environment. Answer Selected Answer: a. IN Correct Answer: b. OUT Question 26 5 out of 5 points

____ can accept and return none, one, or many parameters. Answer Selected Answer: b. Stored procedures Correct Answer: b. Stored procedures Question 27 5 out of 5 points

If no mode is indicated in a parameter, the default value of ______________ is applied. Answer Selected Answer: c. IN Correct Answer: c. IN Question 28 5 out of 5 points

Which of the following cursor declarations is correct to retrieve lastname, salary, and manager id of employees who work in a specific department? Answer Selected Answer: c. CURSOR c_emp_cursor IS SELECT last_name, salary,manager_id FROM employees WHERE department_id = v_deptno; Correct Answer: c. CURSOR c_emp_cursor IS SELECT last_name, salary,manager_id FROM employees WHERE department_id = v_deptno;

Question 29

5 out of 5 points

____ are declared and manipulated in the PL/SQL block code for handling a set of rows returned by a SELECT statement. Answer Selected Answer: d. Explicit cursors Correct Answer: d. Explicit cursors Question 30 5 out of 5 points

Which of the following statements is correct? Answer Selected Answer: b. The value of the SQLCODE is assigned to a variable. Correct Answer: b. The value of the SQLCODE is assigned to a variable. Question 31 5 out of 5 points

Analyze the cursor declaration below. Which of the followings is the correct answer to explain the purpose of this cursor? CURSOR c_dept_cursor IS SELECT department_id,department_name FROM departments WHERE department_id < 100 ORDER BY department_id; Answer Selected Answer: c. To retrieve department_id, and department_name for those departments with department_id less than 100 and process the records in the order by the department_id. Correct Answer: c. To retrieve department_id, and department_name for those departments with department_id less than 100 and process the records in the order by the department_id. Question 32 5 out of 5 points

____ refers to a condition where there is no WHEN clause in the CASE statement. Answer Selected Answer: a. CASE_NOT_FOUND Correct Answer: a. CASE_NOT_FOUND Question 33 5 out of 5 points

The ____ handler should always be the last handler listed in the EXCEPTION section of a block. Answer Selected Answer: d. WHEN OTHERS Correct Answer: d. WHEN OTHERS Question 34 5 out of 5 points

The ____ is an Oracle built-in procedure that allows developers to associate their own error number and message to an error. Answer Selected Answer: c. RAISE_APPLICATION_ERROR Correct Answer: c. RAISE_APPLICATION_ERROR

Question 35

5 out of 5 points

The ____ action used in an explicit cursor processes the query and creates an active set of rows available in the cursor. Answer Selected Answer: b. OPEN Correct Answer: b. OPEN Question 36 5 out of 5 points

____ refers to a SELECT statement in a PL/SQL block that retrieves more than one row. Answer Selected Answer: d. TOO_MANY_ROWS Correct Answer: d. TOO_MANY_ROWS Question 37 5 out of 5 points

The ____ section of a PL/SQL block addresses two situations: either an Oracle error is raised or a user-defined error is raised. Answer Selected Answer: c. EXCEPTION Correct Answer: c. EXCEPTION Question 38 5 out of 5 points

What can be used to simplify processing each row of a set retrieved from a database? Answer Selected Answer: b. CURSOR For LOOP Correct Answer: b. CURSOR For LOOP Question 39 5 out of 5 points

____ returns the Oracle error message. Answer Selected Answer: d. SQLERRM Correct Answer: d. SQLERRM Question 40 5 out of 5 points

A(n) ____ represents a work area or section of memory in which an SQL statement is being processed in the Oracle server. Answer Selected Answer: c. cursor Correct Answer: c. cursor

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy