You are using a PL/SQL program unit in the Orders form to display an image for the selected
product in the Order Items block. The code is called from several different triggers in the form. The
code (with line numbers added) is:
1. PROCEDURE get_image IS
2. Product_image_id ITEM := FIND_ITEM (‘control.product_image’);
3. Filename VARCHAR2(250);
4. BEGIN
5. Filename := TO_CHAR(:order_items.product_id) | | ‘.jpg’;
6. READ_IMAGE_FILE (filename, ‘jpeg’, product_image_id);
7. END;
Management wants all codes to be in PL/SQL libraries to facilitate reuse. You create a PL/SQL
library and drag the program unit from the orders form to the Program Units node of the library.
You then delete the program unit from the Orders form.
What three things must you do to compile the PL/SQL library and to use the code in the Orders
form?
A.
Change line 5 to:
filename := to_char(name_in’order_items.product_id’)) | |’.jpg’;.
B.
insert the RELEASE keyword between lines 1 and 2.
C.
Delete theBEGINand END statements (lines 4 and 7).
D.
Change product_id to aninparameter and filename to an OUT parameter.
E.
Save the library.
F.
Generate the a .plx file.
G.
Attach the library to the orders form.
H.
Change the way the program unit is calledinthe Orders form.
Explanation:
E:Save and compile the library.
G: select the Attached Libraries node and click Create.
In the Attach Library dialog box, click Browse to navigate to the saved library and open it, then
answer Yes to the alert that asks if you want to remove the path.
H: Modify the to simply call the procedure from the attached library:
I think that answer is E, G and A. For E and G is obvious. In pll you cannot use :order_items.product_id – it is necessary to use name_in!
A is not Correct Answer.
Reason: To_Char Function parameter is wrong, but name_in is correct