What must be the value in the ADVT_SOURCE column for the above code to execute successfully?

Examine the structure of the PRINT_MEDIA table:
Name Null? Type
————— ——– ———
ADVT_ID NUMBER
ADVT_SOURCE CLOB
Examine the following PL/SQL block:

DECLARE
lobloc CLOB;
buffer VARCHAR2(100);
amount NUMBER;
offset NUMBER :=1;
BEGIN
buffer :=’This is the second line of a new document’;
amount := LENGTH(buffer);
SELECT advt_source INTO lobloc FROM print_media WHERE advt_id=2 FOR UPDATE;
DBMS_LOB.WRITE(lobloc,amount,offset,buffer);
COMMIT;
END;
/
What must be the value in the ADVT_SOURCE column for the above code to execute
successfully?

Examine the structure of the PRINT_MEDIA table:
Name Null? Type
————— ——– ———
ADVT_ID NUMBER
ADVT_SOURCE CLOB
Examine the following PL/SQL block:

DECLARE
lobloc CLOB;
buffer VARCHAR2(100);
amount NUMBER;
offset NUMBER :=1;
BEGIN
buffer :=’This is the second line of a new document’;
amount := LENGTH(buffer);
SELECT advt_source INTO lobloc FROM print_media WHERE advt_id=2 FOR UPDATE;
DBMS_LOB.WRITE(lobloc,amount,offset,buffer);
COMMIT;
END;
/
What must be the value in the ADVT_SOURCE column for the above code to execute
successfully?

A.
null

B.
an empty locator

C.
a non-NULL value

D.
either null or any non-NULL values



Leave a Reply 2

Your email address will not be published. Required fields are marked *


Leo Yu

Leo Yu

I noticed in DBMS_LOB.WRITE(lobloc,amount,offset,buffer), the offset is the 3rd formal paramter, doesn’t make sense why Oracle design so? DBMS_LOB.WRITE(lobloc,offset, amount,buffer) is more elegent