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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to use UPPER in a view ??? (Scalar Character Functions)

Re: How to use UPPER in a view ??? (Scalar Character Functions)

From: Scott Urman <surman_at_dlsun338.us.oracle.com>
Date: 1997/03/26
Message-ID: <5hbrpc$ktb@inet-nntp-gw-1.us.oracle.com>#1/1

In article <333952eb.93514997_at_news.aud.alcatel.com>, jens_at_deutschware.com (Jens U. Veigel) writes:
|> Hey SQL Gurus !
|>
|> The select statement works. When I try to do it in a view like below,
|>
|> CREATE VIEW stencil_p as
|> select UPPER (slot_num), UPPER (apn_pb_num), UPPER
|> (apn_pba_num), UPPER (pb_alias_num), UPPER (pba_alias_num), UPPER
|> (dsr), thickness, UPPER (work_holder)
|> from ssd.stencil
|> where requirements ='P'
|> and status = 'R'
|>
|> I get the following error:
|>
|> select UPPER (slot_num), UPPER (apn_pb_num) ........
|> *
|> ORA-00998: must name this expression with a column alias
|>
|> What does it mean ??? Thanks for taking the time to read it !!

This means what it says :-) You have to have an alias for it. The reason why is because a view must have valid column names for each column. You could do it with something like:

CREATE VIEW stencil_p as

         select UPPER (slot_num) slot_num, UPPER (apn_pb_num) apn_pb_num, UPPER  (apn_pba_num) apn_pba_num, UPPER (pb_alias_num) pb_alias_num,  UPPER (pba_alias_num) pba_alias_num, UPPER  (dsr) dsr, thickness, UPPER (work_holder) work_holder

         from ssd.stencil
         where requirements ='P'
         and   status = 'R'         

for example. You may want to pick different alias names. If you didn't have column aliases, you couldn't describe the view.

|>
|> PS: Is there a way to implement a case restriction in a combobox ?
|>
|> Thanks
|> Jens
|> jens_at_deutschware.com
|>
|>



Scott Urman Oracle Corporation surman_at_us.oracle.com

Author of _Oracle PL/SQL Programming_ ISBN 0-07-882176-2 Published by Oracle Press - http://www.osborne.com/oracle/index.htm

"The opinions expressed here are my own, and are not necessarily that of  Oracle Corporation"
Received on Wed Mar 26 1997 - 00:00:00 CST

Original text of this message

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