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!

change datatype of a view

758466Mar 11 2010 — edited Mar 11 2010
Hi all,

Is there any method to change the datatype of a view.

create table t(
tot number(6,3),
name char(1)
);

SQL> desc t;
Name Null? Type
----------------------------------------- -------- ----------------
TOT NUMBER(6,3)
NAME CHAR(1)

SQL> create view r as
2 select avg(tot) as avg from t;

SQL> desc r;
Name Null? Type
----------------------------------------- -------- -----------------
AVG NUMBER

I want to convert the datatype of avg from number to number(6,3). How can i do it? Suppose if the ave obtained is 7.66666666, then i should be able to display only 7.66

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 8 2010
Added on Mar 11 2010
3 comments
9,495 views