nerdexam
Oracle

1Z0-146 · Question #128

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…

The correct answer is A. It executes successfully. See the full explanation below for the reasoning.

Question

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?

Options

  • AIt executes successfully.
  • BIt gives an error because VARCHAR2 should be explicitly converted to CLOB.
  • CIt gives an error because CLOB variables should be initialized to EMPTY_CLOB().
  • DIt gives an error because the concatenation operator cannot be used with the CLOB data type.

How the community answered

(20 responses)
  • A
    85% (17)
  • B
    10% (2)
  • D
    5% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-146 Practice