QuestionQ8

VerifiedPL/SQL Language Fundamentals

Examine the structure of the ora1.depts table:

Question Image

Now examine these statements, issued successfully by user ora1:

Create or replace view dep_vu as select * from depts;  
Alter table depts add dep_email varchar2(20);  

Finally, examine this block of code executed by user ora1:

Question Image

Which statement is true?

Explanation

Oracle expands SELECT * in a view definition to the base-table columns that exist when the view is created. A column subsequently added to the base table is not included in the view until the view is recreated with CREATE OR REPLACE VIEW. Thus, ORA1.DEP_VU retains its original four columns, and ALL_TAB_COLUMNS returns a count of 4 for that view.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!