Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. TCO 4 - Which of the following code fragments correctly uses a record variabl

ID: 642083 • Letter: 1

Question

1. TCO 4 - Which of the following code fragments correctly uses a record variable to hold the row of data queried for a shopper? (Points : 4)        DECLARE
rec_shopper bb_shopper%ROWTYPE;
BEGIN
SELECT*
INTO rec_shopper
FROM bb_shopper
WHERE idshopper = :g_shopper;
DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname);
DBMS_OUTPUT.PUT_LINE(rec_shopper.address);
DBMS_OUTPUT.PUT_LINE(rec_shopper.email);
END;
       DECLARE
rec_shopper bb_shopper%ROW;
BEGIN
SELECT*
INTO rec_shopper
FROM bb_shopper
WHERE idshopper = :g_shopper;
DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname);
DBMS_OUTPUT.PUT_LINE(rec_shopper.address);
DBMS_OUTPUT.PUT_LINE(rec_shopper.email);
END;
       DECLARE
rec_shopper bb_shopper%TYPE;
BEGIN
SELECT*
INTO rec_shopper
FROM bb_shopper
WHERE idshopper = :g_shopper;
DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname);
DBMS_OUTPUT.PUT_LINE(rec_shopper.address);
DBMS_OUTPUT.PUT_LINE(rec_shopper.email);
END;
       DECLARE
rec_shopper bb_shopperROWTYPE;
BEGIN
SELECT*
INTO rec_shopper
FROM bb_shopper;
WHERE idshopper = :g_shopper;
END; Question 2.2. TCO 4 - ____ are declared and manipulated in the PL/SQL block code for handling a set of rows returned by a SELECT statement. (Points : 4)        Implicit cursors
       Collections
       Index-by tables
       Explicit cursors Question 3.3. TCO 4 - A(n) ____ of data typically includes a number of different fields. (Points : 4)        row
       collection
       assignment statement
       variable Question 4.4. TCO 5 - All of the following are purity level acronyms, except ____. (Points : 4)        WNPS
       RINDS
       WNPS
       RNPS Question 5.5. TCO 5 - Which of the following is identified with a set of acronyms that indicate the restrictions on using the function? (Points : 4)        Compiler hint
       Purity level
       Pass by reference
       Pass by value Question 6.6. TCO 5 - At least one ____ statement must be included in a function body to instruct which value to return. (Points : 4)        CREATE
       RETURN
       BEGIN
       EXCEPTION Question 7.7. TCO 6 - Which of the following procedures is used to populate the dependency data for the object of interest? (Points : 4)        USER_DEPENDENCY
       DEPTREE_FILL
       DEPTREE
       DEPTREE.FILL Question 8.8. TCO 6 - All of the following represent packaged function purity levels, except ____. (Points : 4)        WNDS
       RNDS
       WNPS
       RNPS Question 9.9. TCO 6 -
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;
The code fragment above is an example of a(n) ____. (Points : 4)        anonymous block
       package body
       package specification
       package scope 1. TCO 4 - Which of the following code fragments correctly uses a record variable to hold the row of data queried for a shopper? (Points : 4)        DECLARE
rec_shopper bb_shopper%ROWTYPE;
BEGIN
SELECT*
INTO rec_shopper
FROM bb_shopper
WHERE idshopper = :g_shopper;
DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname);
DBMS_OUTPUT.PUT_LINE(rec_shopper.address);
DBMS_OUTPUT.PUT_LINE(rec_shopper.email);
END;
       DECLARE
rec_shopper bb_shopper%ROW;
BEGIN
SELECT*
INTO rec_shopper
FROM bb_shopper
WHERE idshopper = :g_shopper;
DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname);
DBMS_OUTPUT.PUT_LINE(rec_shopper.address);
DBMS_OUTPUT.PUT_LINE(rec_shopper.email);
END;
       DECLARE
rec_shopper bb_shopper%TYPE;
BEGIN
SELECT*
INTO rec_shopper
FROM bb_shopper
WHERE idshopper = :g_shopper;
DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname);
DBMS_OUTPUT.PUT_LINE(rec_shopper.address);
DBMS_OUTPUT.PUT_LINE(rec_shopper.email);
END;
       DECLARE
rec_shopper bb_shopperROWTYPE;
BEGIN
SELECT*
INTO rec_shopper
FROM bb_shopper;
WHERE idshopper = :g_shopper;
END;

Explanation / Answer

1) DECLARE
rec_shopper bb_shopper%ROW;
BEGIN
SELECT*
INTO rec_shopper
FROM bb_shopper
WHERE idshopper = :g_shopper;
DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname);
DBMS_OUTPUT.PUT_LINE(rec_shopper.address);
DBMS_OUTPUT.PUT_LINE(rec_shopper.email);
END;

2)Collections

3) variable

4) WNPS

5) Compiler hint

6)RETURN

7)USER_DEPENDENCY

8)RNPS

9) package body