Re: How can view keep columns from dictionary

  • From: Jacek Gębal <jgebal@xxxxxxxxx>
  • To: ecandrietta@xxxxxxxxx
  • Date: Wed, 15 Jul 2020 22:53:16 +0100

What are you trying to achieve really?
Do you need view for that?
Views have static columns list and you need to redefine the view to include
new columns.

On Wed, 15 Jul 2020, 22:26 Eriovaldo Andrietta, <ecandrietta@xxxxxxxxx>
wrote:

Hello,

I have a doubt about this code :

drop table test;
create table test
(col1 number,
 col2 number);

create view vtest
as
select * from test;

select * from vtest; -- 2 columns

alter table test add col3 number; -- here table has 3 columns

select * from vtest; -- view keeps using 2 columns

Is there a way to retrieve the current columns from table when
created view as select * from table withou change the view  ?

Regards
Eriovaldo


Other related posts: