Oracle
1Z0-146 · Question #24
Examine the PL/SQL code for the GET_TABLE_MD function given below: CREATE OR REPLACE FUNCTION get_table_md RETURN CLOB IS h NUMBER; th NUMBER; doc CLOB; BEGIN h := DBMS_METADATA.OPEN('TABLE')…
The correct answer is C. The function retrieves the metadata as a data definition language (DDL) statement for creating the. See the full explanation below for the reasoning.
Question
Examine the PL/SQL code for the GET_TABLE_MD function given below:
CREATE OR REPLACE FUNCTION get_table_md RETURN CLOB IS h NUMBER; th NUMBER; doc CLOB; BEGIN h := DBMS_METADATA.OPEN('TABLE'); DBMS_METADATA.SET_FILTER(h,'SCHEMA','HR'); DBMS_METADATA.SET_FILTER(h,'NAME','TIMECARDS'); th := DBMS_METADATA.ADD_TRANSFORM(h,'DDL'); doc := DBMS_METADATA.FETCH_CLOB(h); DBMS_METADATA.CLOSE(h); RETURN doc; END; Which statement is true about the compilation and execution of the function?
Options
- AThe function retrieves the metadata in Extensible Markup Language (XML) format for creating the
- BThe compilation produces an error because DBMS_METADATA.SET_FILTER(h,'SCHEMA','HR')
- CThe function retrieves the metadata as a data definition language (DDL) statement for creating the
- DThe execution of the function produces an error because multiple objects are fetched and
How the community answered
(30 responses)- A3% (1)
- B7% (2)
- C77% (23)
- D13% (4)
Community Discussion
No community discussion yet for this question.