Multiple choice technology databases

DATA_FILES is a directory object that contains the DETAILS.TXT text file. You have the required permissions to access the directory object. You create a table using the following command: CREATE TABLE clob_tab(col2 CLOB); View the Exhibit and examine the PL/SQL block that you execute for loading the external text file into the table that currently has no rows. The PL/SQL block results in an error. What correction must be done to ensure the PL/SQL block executes successfully?

  1. The L_OUT variable must be initialized to an empty locator.

  2. The L_OUT variable has to be declared as a temporary LOB.

  3. The A_CLOB variable has to be declared as a temporary LOB.

  4. The clause RETURNING col2 INTO a_clob should be added to the INSERT statement to correctly initialize the locator.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

To load files into a CLOB column, the LOB locator must be initialized first. The RETURNING clause in the INSERT statement initializes the locator variable with a pointer to the newly created empty CLOB row, allowing subsequent DBMS_LOB operations to write to it.