Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: select in a view

Re: select in a view

From: <nainm_at_my-deja.com>
Date: Thu, 17 Jun 1999 18:21:55 GMT
Message-ID: <7kbebm$qgv$1@nnrp1.deja.com>


You've created a view with aliases for the columns(with mixed or lower case) and you surrounded them aliases with double quotes.

Try
select "<alias_as_given_in_view_definition>" from <your_view>;

Or better is to create view without double quotes for column aliases or column aliases in upper case.

An example
SQL> desc xyz

 Name                            Null?    Type
 ------------------------------- -------- ----
 AAA                                      VARCHAR2(10)
 BBB                                      VARCHAR2(10)
 CCC                             NOT NULL NUMBER(10)

SQL>create or replace view xyzxyz ("aa",bb,cc) as  2 (select aaa,bbb,ccc from xyz);
View created

SQL>select aa from xyzxyz;
select aa from xyzxyz

       *
ERROR at line 1:
ORA-00904: invalid column name

SQL> select "aa" from xyzxyz;
aa



a0001
a00001
aaaa

3 rows selected.

In article <7kb76h$nb8$1_at_nnrp1.deja.com>,   cdoganay_at_my-deja.com wrote:
> I have Oracle 7.3.4 on Windows NT. When I select * from a_view, I can
> get the results, but when I try to select any individual column, I
> receive
> invalid column name error.
>
> Same tables and views work fine on another version and OS. Do I miss
> anything?
>
> Cemal
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu Jun 17 1999 - 13:21:55 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US