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: column aliases in views

Re: column aliases in views

From: Jerome Vitalis <vitalismanN0SP4M_at_gmail.com.invalid>
Date: Thu, 11 Jan 2007 13:41:21 +0100
Message-ID: <45a62f7e$0$694$426a74cc@news.free.fr>


Filipe David Borba Manana wrote:
> I'm trying to create this view:
>
> CREATE OR REPLACE VIEW vwaccounting
> (
> hostname,
> accountname,
> clustername,
> hwmodel,
> landbhw,
> disksize,
> power,
> state,
> warranty
> )
> AS
> SELECT hostname,
> NVL(get_value(hostname, '/system/accounting/name'), 'undefined')
> AS account,
> clustername,
> hwmodel,
> get_value(hostname, '/hardware/vendor'),
> NVL(NVL(get_value(hostname, '/hardware/harddisks/hda/capacity'),
> get_value(hostname, '/hardware/harddisks/sda/capacity')), 0),
> NVL(get_value(hostname, '/hardware/cpus/0/si2k') +
> get_value(hostname, '/hardware/cpus/1/si2k'), 0),
> state,
> CASE WHEN fngetwarrantyend(hostname) > current_date THEN account
> || ' total warr-in' ELSE account || ' total warr-out' END
> FROM CDB.VWHOST
>
>
> But I always get the error which says that "account" is an invalid
> identifier. I also tried to use the identifier "accountname", defined in
> the view's header, and I got the same error.
>
> Is it not possible to use column aliases in a view definition?
>
> many thanks

Oracle version ?

A stab in the dark: does the replacement of the two "account" with NVL(get_value(hostname, '/system/accounting/name'), 'undefined') in the CASE clause help in correcting the error? Received on Thu Jan 11 2007 - 06:41:21 CST

Original text of this message

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