You created a procedure as follows:
CREATE OR REPLACE PROCEDURE query_prod(twhr VARCHAR2)
IS
stmt VARCHAR2(100);
pname VARCHAR2(20);
BEGIN
stmt:=’SELECT product_name FROM products WHERE product_id=:2′;
EXECUTE IMMEDIATE stmt INTO pname USING twhr;
DBMS_OUTPUT.PUT_LINE(pname);
END;
/
View the Exhibit to examine the structure of PRODUCTS table.
Which statement is true about the procedure?
A.
It produces an error when invoked.
B.
It can be invoked only from a PL/SQL block.
C.
It reduces the chances of SQL injection by using bind arguments.
D.
The values for bind arguments remain persistent in the session after the execution of the
procedure.
C