Examine the structure of the TEXT_TAB table.
Name Null? Type
————— ——– ———-TEXT_ID NUMBER
DOC1 CLOB
DOC2 CLOB
You issue the following INSERT commands:
INSERT INTO text_tab VALUES (1, ‘This is line 1’,null);
INSERT INTO text_tab VALUES (2, ‘This is line 1′,’This is line 2’);
Then you execute the following block of the PL/SQL code:
DECLARE
vc1 VARCHAR2(1000):= ‘This is the preface’;
lb1 CLOB;
lb2 CLOB;
BEGIN
SELECT doc1 INTO lb1 FROM text_tab WHERE text_id=1;
SELECT doc1 || doc2 INTO lb1 FROM text_tab WHERE text_id=2;
lb2 := vc1|| lb1;
UPDATE text_tab SET doc2 = lb2 WHERE text_id = 1;
END;
/
What is the outcome?
A.
It executes successfully.
B.
It gives an error because VARCHAR2 should be explicitly converted to CLOB.
C.
It gives an error because CLOB variables should be initialized to EMPTY_CLOB().
D.
It gives an error because the concatenation operator cannot be used with the CLOB data type.
A
D
OPS
I CAN’T BELIVE
CREATE TABLE TEXT_TAB
(
TEXT_ID NUMBER,
DOC1 CLOB,
DOC2 CLOB )
You issue the following INSERT commands:
INSERT INTO text_tab VALUES (1, ‘This is line 1’,null);
INSERT INTO text_tab VALUES (2, ‘This is line 1′,’This is line 2’);
SELECT * FROM TEXT_TAB
TEXT_ID DOC1 DOC2
1, This is line 1 ,
2, This is line 1 , This is line 2
Then you execute the following block of the PL/SQL code:
DECLARE
vc1 VARCHAR2(1000):= ‘This is the preface’;
lb1 CLOB;
lb2 CLOB;
BEGIN
SELECT doc1 INTO lb1 FROM text_tab WHERE text_id=1;
SELECT doc1 || doc2 INTO lb1 FROM text_tab WHERE text_id=2;
lb2 := vc1 || lb1;
UPDATE text_tab SET doc2 = lb2 WHERE text_id = 1;
END;
SELECT * FROM TEXT_TAB
TEXT_ID DOC1 DOC2
1, This is line 1 This is the prefaceThis is line 1This is line 2
2, This is line 1 This is line 2
PLEASE someone can explin me
what is written in a clob locator ?
pointers or values ?
if pointers are…. what does it means to oncatenate two pointers ?
how can it works ?
thanks
OK, ASSUMED IT WORKS.
A
A.
Table created.
1 row created.
1 row created.
PL/SQL procedure successfully completed.
DMBS_OUTPUT:
This is line 1
This is line 1This is line 2
This is the prefaceThis is line 1This is line 2
SQL> select doc2 from TEXT_TAB where text_id = 1;
doc2
———
This is the prefaceThis is line 1This is line 2