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: Result field

Re: Result field

From: Ed prochak <ed.prochak_at_magicinterface.com>
Date: 19 Jul 2004 10:45:01 -0700
Message-ID: <4b5394b2.0407190945.3c965b80@posting.google.com>


patrick.vanhoof_at_haven.antwerpen.be (Patrick Vanhoof) wrote in message news:<27e1c74c3cf7c1b89abc6d814aa2a2b2$1_at_www.orafaq.net>... []
>
> Hi,
>
> I have a table which contains a field (referred to below as
> "SCHEMA2"."FIELD2") with following format: NUMBER(9,3).
>
> Now I create a view based on this and another table, which contains a case
> statement like:
>
> CASE WHEN "SCHEMA1"."FIELD1" = 'A' THEN "SCHEMA2"."FIELD2" ELSE NULL END
> AS NameOfField
>
> The resulting format of the field NameOfField in the view however now is
> NUMBER. I seem to have lost the (9,3) part.
>
> How can I make sure that in my view the result field is also NUMBER(9,3)?
>
> All help very much appreciated.
>
> Patrick
>

First let's get terms straight. Files have records with fields. Database tables have rows with attributes or columns. Tables don't have fields.

You did not loose the (9,3) part. The column "FIELD2" has data type of NUMBER and the resulting column in the view is type NUMBER. Nothing was lost. Try querying the view and you'll see the values come out just like they would if you query them directly from the base table.

If you want to change the display format, you can convert the value to text (datatype CHAR) with the TO_CHAR() function for example. There are other ways to format this as well.

The bottom line is that you are worrying about minute details that are not important.

HTH,
  ed Received on Mon Jul 19 2004 - 12:45:01 CDT

Original text of this message

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