Examine the structure of the TEST_DETAILS table:
Name Null? Type
————— ——– ———
TEST_ID NUMBER
DESCRIPTION CLOB
DESCRIPTION data was entered earlier and saved for TEST_ID 12.
You execute this PL/SQL block to add data to the end of the existing data in the DESCRIPTION
column for TEST_ID 12:
DECLARE
clob_loc CLOB;
buf CHAR(12);
BEGIN
SELECT description INTO clob_loc FROM test_details WHERE test_id = 12 ;
buf := ‘0123456789’;
DBMS_LOB.WRITEAPPEND(clob_loc,DBMS_LOB.GETLENGTH(buf), buf);
COMMIT;
END;
/
It generates an error on execution.
What correction should you do to achieve the required result?
A.
WRITEAPPEND must be replaced with APPEND.
B.
The BUF variable data type must be changed to CLOB.
C.
FOR UPDATE must be added to the SELECT statement.
D.
The GETLENGTH routine must be replaced with the LENGTH built-in function in
WRITEAPPEND.
C