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: How to get info on view columns' source (field) ?

Re: How to get info on view columns' source (field) ?

From: Bjørge Sæther <bjorge_at_hahaha_itte.no>
Date: Sun, 13 Oct 2002 19:54:00 GMT
Message-ID: <sbkq9.4102$jS5.85330@news2.ulv.nextra.no>


"Scott Mattes" <Scott_at_TheMattesFamily.ws> skrev i melding news:eFFp9.22437$m92.5059430_at_news1.news.adelphia.net... [...]
> In Delphi, if you set the query active, then open the field editor and
> populate it with all the fields and click on a field the object inspector
> will show all sorts of field information. Or, if your query will be used
for
> many different queries you can get the same type of information after the
> query is opened.

This part works, getting field names, data types, etc... What I need in addition, is the source of the field (either SOMETABLE.SOMECOL or e.g. "<calculated>"). I'm having a table with "application metadata" telling whether a field should be available for search/filtering, some additional display options, lookup definitions, etc.., and it would be very nice to avoid duplicating metadata when a field is accessed both through a view and by selecting directly from table.

> As of at least Delphi 4 the property that should tell you the table name
of
> the field was broken (it could only tell you the table name of the fields
> for the first table listed in the 'from' part of the statement is what I
> recall), and I haven't been on a Delphi project since that release, so I
> don't have access to the Pro version to check if it has been fixed.

I don't know what you mean - is this a property of TQuery.Fields, or are you talking about "Direct Oracle Access" - components ?

> "Bjørge Sæther" <bjorge_at_hahaha_itte.no> wrote in message
> news:A4Ep9.2813$jS5.62616_at_news2.ulv.nextra.no...
> > "Scott Mattes" <Scott_at_TheMattesFamily.ws> skrev i melding
> > news:0_zp9.22047$m92.4975974_at_news1.news.adelphia.net...
> > > Delphi, now there is a RAD!
> >
> > No RAD at all...dealing with it programmatically wasn't excactly what
> Delphi
> > was built for...;-)
> >
> > > The view ALL_VIEWS contains the source used to create the view (its
the
> > only
> > > place that I know of for the information). 'Just' parse it out to find
> the
> > > table/s and field/s of the view, then look in ALL_TAB_COLUMNS for the
> > > information you want.
> >
> > Yes, I know that I can get the source.....just didn't want to actually
> > *write* an SQL parser...expecially when dealing with a variety of Oracle
> SQL
> > statements...
> >
> > I was afraid of that answer...but thank you !
> >
> > >
> > > "Bjørge Sæther" <bjorge_at_itte.no> wrote in message
> > > news:1ccf751c.0210110404.4995841a_at_posting.google.com...
> > > > Hi !
> > > >
> > > > (Ora 8.1.6)
> > > >
> > > > Given this table:
> > > >
> > > > CREATE TABLE PERSON (
> > > > ID NUMBER(38) NOT NULL PRIMARY KEY,
> > > > FIRST_NAME VARCHAR2(50),
> > > > LAST_NAME VARCHAR2(50)
> > > > )
> > > >
> > > > ...and this view:
> > > >
> > > > CREATE VIEW PERSON_LIST AS
> > > > SELECT
> > > > ID,
> > > > FIRST_NAME||' '||LAST_NAME NAME
> > > > FROM
> > > > PERSON
> > > >
> > > > ...I want to get this information from Oracle about the view (format
> > > > is not important, it is for internal use in a Delphi application):
> > > >
> > > > FIELD SOURCE
> > > > -------------
> > > > ID PERSON.ID
> > > > NAME (CALCULATED)
> > > >
> > > > ...??
> > > >
> > > > Thanks in advance !
> > > >
> > > > Bjørge
> > >
> > >
> >
> > --
> > Bjørge Sæther
> > bjorge_at_hahaha_itte.no
> >
> >

>
>

--
Bjørge Sæther
bjorge_at_hahaha_itte.no
Received on Sun Oct 13 2002 - 14:54:00 CDT

Original text of this message

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