Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Alter table column datatype

palkodiJul 5 2018 — edited Jul 5 2018

I'm modifying the data type of a column. When doing so I get the following error:
ORA-54033: column to be modified is used in a virtual column expression

create table tab (

percentage  number,

  y date,

  amount number

);

alter table tab modify (percentage varchar2(100 byte));

ORA-54033: column to be modified is used in a virtual column expression;

select column_name, data_default, hidden_column

from user_tab_cols

where table_name = 'TAB';

COLUMN_NAME                                                  DATA_DEFAULT                                                                         HID

----------- ------------ ---

SYS_STUYPW88OE302TFVBNC6$MMQXE       SYS_OP_COMBINED_HASH("percentage","amount" )           YES

Percentage                                                                                                                                                                NO

Y                                                                                                                                                                               NO

Amount                                                                                                                                                                     NO

so i dropped the extended status

exec dbms_stats.drop_extended_stats(user, 'tab', '(Percentage,Amount  )');

alter table tab modify (percentage varchar2(100 byte));

gives error so I did this one

ALTER TABLE tab

ADD (Percentage1 VARCHAR2(100 byte));

update tab set Percentage1 =Percentage;

ALTER TABLE tab DROP COLUMN Percentage;

ALTER TABLE tab

RENAME COLUMN Percentage1 TO Percentage;

now I want to recreate the dbms_Stats

exec DBMS_STATS.CREATE_EXTENDED_STATS(user, 'tab', '(Percentage,Amount  )');

PLS-00306: wrong number or types of arguments in call to 'CREATE_EXTENDED_STATS' do help thank you

Message was edited by: palkodi

This post has been answered by Dir_Pal on Jul 5 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2018
Added on Jul 5 2018
13 comments
698 views