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: Identifing the source of a view column

Re: Identifing the source of a view column

From: Spencer <spencerp_at_swbell.net>
Date: Sat, 3 Mar 2001 19:41:11 -0600
Message-ID: <v2ho6.406$na.8110@nnrp1.sbc.net>

no. a script to do what you propose would be of dubious value, since the "source" for a view column can be any expression, not necessarily a simple expression like the name of a column from a view or table.

you need the complete source of the view to tell the whole story. simply picking out an expression from the outermost select list and taking it out of context could be misleading.

take, for example, this view definition:

CREATE OR REPLACE VIEW v1 (f1, f2)
AS
SELECT t3.f3

     , t2.f2
  FROM (SELECT f1 As f3

             , f2 As f2
          FROM t1
       ) t3
     , t2

 WHERE t3.f3=t2.f1;

outside of the context of the view definition, "t3.f3" does not have much meaning. and since "t3" could actually be the name of another view or table containing a column named "f3", reporting the "source" of "v1.f1" as "t3.f3" could be misleading.

you really need to review the entire text of the view definition in order to determine the "source" of a column from the view.

"Peter" <P.Slingerland_at_IMN.nl> wrote in message news:97ivp9$me4$1_at_nereid.worldonline.nl...
> Hello,
>
> Does anyone know a script to select the source column for a view column.
>
> For example:
>
> create view v1 (f1, f2)
> as select t1.f2, t2.f2
> from t1,t2
> where t1.f1=t2.f1;
>
> When I want the know the source for v1.f1 the script or function should
> return
> t1.f2.
>
> Thanks,
>
>
> Peter
>
>
Received on Sat Mar 03 2001 - 19:41:11 CST

Original text of this message

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