Home » RDBMS Server » Server Administration » Where are column aliases in views stored?
Where are column aliases in views stored? [message #57210] Wed, 28 May 2003 10:54 Go to next message
Reiner Dieg
Messages: 2
Registered: May 2003
Junior Member
Where are the aliases for columns (required when a column in a view is a function, for example) stored in the data dictionary? USER_VIEWS gives only the query, not the aliases.
Re: Where are column aliases in views stored? [message #57229 is a reply to message #57210] Thu, 29 May 2003 06:53 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
i dont get you.
May be, i am wrong.
a view is a stored query.
oracle stores the base query 'as it is' and executes the sql.
mag@itloaner1_local > ed
Wrote file afiedt.buf

  1  create or replace view sample
  2  as
  3  select deptno,count(*) as countofemployees from emp
  4* group by deptno
mag@itloaner1_local > /

View created.

mag@itloaner1_local > desc sample
 Name                                                  Null?    Type
 ----------------------------------------------------- -------- ------------------------------------
 DEPTNO                                                         NUMBER(2)
 COUNTOFEMPLOYEES                                               NUMBER

mag@itloaner1_local > select text from user_views where view_name='SAMPLE';

TEXT
--------------------------------------------------------------------------------
select deptno,count(*) as countofemployees from emp
group by deptno

Re: Where are column aliases in views stored? [message #57232 is a reply to message #57229] Thu, 29 May 2003 07:58 Go to previous message
Reiner Dieg
Messages: 2
Registered: May 2003
Junior Member
But I could also define a view like this:
create or replace view sample (empno, roundsal)
as select empno, round(sal,-1) from emp;
User_views would give me the select statement, but where is the alias "roundsal" stored?
Thanks,
Reiner
Previous Topic: Reverse Index
Next Topic: redo log sync
Goto Forum:
  


Current Time: Fri Sep 20 09:45:27 CDT 2024