Exam 1z0-149 All QuestionsBrowse all questions from this exam
Question 40

Examine the structure of the ora1.depts table:

Now, examine these statements issued by user ora1 which execute successfully:

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:

Which is true?

    Correct Answer: D

    When the view DEP_VU was created, it captured the structure of the depts table at that time, which had four columns: DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, and LOCATION_ID. After the view was created, a new column, dep_email, was added to the depts table. However, this alteration does not automatically update the view. When selecting from all_tab_columns for DEP_VU, it will only show the columns present when the view was last created or compiled. Therefore, the view DEP_VU must be manually recompiled to include the new column. As a result, the query will run successfully producing a result of 4, not 5. Thus, Option D is correct.

Discussion
jfc1Option: B

tested

thranduylOption: B

tested B

jm9999

what is colcount? Does not run on my SQLDeveloper version 23 unless I remove that word?

serkan110Option: C

No B, it will create the view with the column names that existed before

thranduyl

if you create the view and add colum, and if you execute this query return four records

2oracleexamOption: B

B, tested

Raju_thangavelOption: A

Answer is A?