Need to know base table and base column name for Oracle view columns

I am trying to load metadata for some views and that requires me to know what the final table and column name would be corresponding to the view column.
For example, if I have a view x_v that is select a,b from x_v2; and x_v2 is a view that is select a,b,c from x;
I need to get the following information.
View View Col Base Table Base Col
X_V A X A
X_V B X B
and so on.
Is it possible to get this programmatically using any SYS schema tables or Dependency tables?
I tried an indirect approach wherein I lock tables using LOCK TABLE or FOR UPDATE OF. But I'm not too sure if I can go down to the level of individual view columns.
Can you help me with this?

Thanks. I was looking at some indirect approaches.
I came up with this script that does it faster than dependencies but thats just for tables and not column mapping.
declare
cursor bt(cp_sid number) is
select u.name uname, o.name oname
from sys.obj$ o, sys.user$ u
where o.obj# in (select id1
from v$lock
where sid=cp_sid)
and u.user# =o.owner#;
cursor c_sid is
select sid
from v$session
where audsid =userenv('sessionid');
l_sid number;
l_view varchar2(100):= 'PER_PEOPLE_V';
l_schema varchar2(10):= 'APPS';
begin
open c_sid;
fetch c_sid into l_sid;
close c_sid;
dbms_output.put_line('SID: '||l_sid);
execute immediate 'lock table '||l_schema||'.'||l_view||' in row share mode nowait';
for i in bt(l_sid) loop
dbms_output.put_line(i.uname||'.'||i.oname);
execute immediate 'alter table '||i.uname||'.'||i.oname||' disable table lock';
execute immediate 'alter table '||i.uname||'.'||i.oname||' enable table lock';
end loop;
end;
It basically uses locks on views to verify locks on the base tables.
Just wondering, can we use FOR UPDATE OF statements to get to the columns?

Similar Messages

  • Do We Need To Know All Tables and Fields inR/3

    We are in the initial phase of BW development(We don't have Functional consltant with us).Our source System is R/3. According to Reporting requirement We have identified certain DataSources in Business Content Which have basic Characteristics and Key Figures which we require in report.
    but still lot of fields are there in R/3 which we are not finding in Datasources ?. My question is Do we need to know for each Characteristic and key figure the base table in R/3 and corresponding field name in R/3.
    We found certain fields are common in 4 - 5 Tables in R/3,So how do we know that certain field is coming from certain table only.
    Here i want to ask, the Business content datasources in which we have certain chars and key figures which we require. do we need to know from which table these are comming or connected to in R/3??.
    So the bottom line is ,do we need to see and analyse  for each BEx report. what the corresponding field and table in R/3 is.
    I would award points to rational answers.
    regards
    Srini----

    Hello Srini,
    If all your requiremnts are fulfilled by the Business content objects, then you may impelement BW without going into much details in R/3. But that is a wishful thinking and doesn't happen in real scenario. Also, even if you implemented business content, while verifying the result you have to go the source system and compare the results.
    In most of the projects, you need to enhance the business content delivered objects. While enhaching the datasources in R/3, you must know from which table to take the information. Many a times, the end users have R/3 experience and they tell you what information you are looking for, in that case life will be a bit easier. But if the user wants to see some information which is being captured as part of any particular transaction, you need to dig deep in R/3 to find out the table and how that can be extracted.
    So, I would say at least little knowledge of R/3 is necessary. You may not need a full time functional consultant, but someone who has R/3 experience will be of great help.
    Hope it helps.
    Regards,
    Praveen

  • Dynamic column name for Oracle Server Procedure

    hello,
    May be it's not a right place for my question, but I hope that some of you can help me.
    I have source table A that has data of the same kind in 62 fields, let's say employee count for 62 departments. I do some processing with these counts(sum(emp_count) of the same departments for different locations) and store these counts in the variables EC1, EC2, EC3 .. EC62.
    Then I need to insert them into my table that has very simple structure let's say table B (dept_no Number(3),
    emp_count Number(6))
    I want to do a loop and use dynamic colunm EMP_COUNT, something like this:
    FOR k in 1..62 LOOP
    EMP_COUNT := 'EC'| |k;
    IF EMP_COUNT <> O THEN
    insert into B
    VALUES ( K , EMP_COUNT);
    END IF;
    END LOOP;
    I understand that I need to take a Value of my dynamic colunm EMP_COUNT. Is it possible to do in Oracle Server Procedure? Any idea?
    Any help will be apreciated.
    null

    After having worked in other environments where you can manipulate data records with postitional parameters, Oracle can be frustrating because it demands the explicit use of field names in DML/Select statements. A way around this is to use DBMS_SQL or Dynamic Sql. I have used DBMS_SQL to create and execute dynamic statements with great success. Since you are creating, compiling, and running a dynamic block every time you execute your procedure, this is not recommended except in the rare instances when there is no better way around it.
    Oracle8i introduces native dynamic SQL, an alternative to DBMS_SQL. Using native dynamic SQL, you can place dynamic SQL statements directly into PL/SQL blocks.
    In most situations, native dynamic SQL can replace DBMS_SQL. Native dynamic SQL is easier to use and performs better than DBMS_SQL.
    Example of Dynamic SQL<------------------------
    BEGIN
    -- bulk fetch the list of office locations
    SELECT location BULK COLLECT INTO loc_array
    FROM offices;
    -- for each location, give a raise to employees with the given 'job'
    FOR i IN loc_array.first..loc_array.last LOOP
    dml_str := 'UPDATE emp_' &#0124; &#0124; loc_array(i)
    &#0124; &#0124; ' SET sal = sal * (1+(:raise_percent/100))'
    &#0124; &#0124; ' WHERE job = :job_title';
    EXECUTE IMMEDIATE dml_str USING raise_percent, job;
    END LOOP;
    Look for more information on dynamic SQL by
    searching for DBMS_SQL.
    Good Luck
    null

  • Aggregation table - Diffrent agg levels for base table and agg table

    Is it possible to have Different aggregation level for base table and Aggregation. Say sum on a column in AGG table and Count for the same column in Fact table.
    Example
    Region,Day_product,sales person, customer are dimensions and Call is a fact measure
    FACT_TABLE has columns Region, Day, Product, Sales person,Customer, Call
    AGG_TABLE has columns Region, Month,Product, call
    We already have a Logical Table definition for the fact table say FACT_CALL
    We have a Logical column called No of customers.
    For the Data source as FACT_TABLE Formula for the column is "Customer" and Aggregation level is count distinct.
    But agg table we already have a calculated column call TOT_CUSTOMERS. which is been calculated and aggregated in the ETL.
    IF we map this to the logical column we have to set the formula as TOT_CUSTOMERS and we need to define aggregation type as SUM as this is at REGION, MONTH AND Product level. But OBI does not allow to do so.
    Is there a work around for this? Can you please let us know.
    Regard
    Arun D

    The way BI server picks up the table that would satisfy the query is through column mappings and contents levels. You have set the column mappings to TOT_CUSTOMER, which is right. When it comes to aggregation, since its already precalculated through ETL, you want to set the aggregation to SUM. Which I would say - is not correct, you can set the aggregation to COUNT DISTIMCT which is same as that of the detailed fact. But set the content levels to month in date table, and appropriate levels in region etc., So now BI Server will be aware of how to aggregate the rows when it chooses the agg table.

  • Skip Base station and just use AppleTV for WiFi?

    Hello all.
    I am currently using Airport base station extreme (6th edition) with the Apple TV 3rd edition. My question is,
    I'm moving out and I wanted to split the two up. I would take the base station and leave the AppleTV for my roommate.
    Is it possible to use the AppleTV to broadcast  WiFi single and use it for channels if I plug the cable modem directly to the AppleTv?
    Roommate will only be using the TV with an antenna for local channels and apple TV for netflix. They still want WiFi in the house though for internet.
    What are my options?

    If you want to use it (without a data plan) as a GPS, you'll need to purchase a navigation app that has built-in maps.  Navigon is one, although I can't recommend it.  Google for reviews of others.

  • Need to know the roll and responsibilty for AP,PO etc module for users

    Hi All,
    I need to know the roll and responsibilty for AP & purchase module etc for all the users, I have to give all the details for auditing.
    Thanks,
    Edited by: Quadri on Mar 9, 2010 11:39 PM
    Edited by: Quadri on Mar 9, 2010 11:41 PM

    Hi,
    execute the below query to find the details with application name
    SELECT distinct
    B.RESPONSIBILITY_ID,
    A.RESPONSIBILITY_NAME,
    A.LANGUAGE,
    B.RESPONSIBILITY_KEY ,
    B.APPLICATION_ID,
    C.USER_MENU_NAME,
    E.APPLICATION_NAME
    FROM APPS.FND_RESPONSIBILITY_TL A,
    APPS.FND_RESPONSIBILITY B,
    APPS.FND_MENUS_TL C,
    APPS.FND_MENUS D,
    apps.FND_APPLICATION_TL E,
    apps.FND_APPLICATION F
    WHERE A.RESPONSIBILITY_ID(+)=B.RESPONSIBILITY_ID
    AND B.MENU_ID=C.MENU_ID
    AND B.MENU_ID=D.MENU_ID
    AND E.APPLICATION_ID=F.APPLICATION_ID
    AND F.APPLICATION_ID=B.APPLICATION_ID
    AND A.LANGUAGE='US'
    Regards

  • Table Name and Column name for Product Family Field under the Product Famil

    Hi,
    Please help me finding the table name and the column name for the 'Product Family' field and the 'Item' field under the Product families form. The navigation to this form is as follows:
    Material Planner Responsibility -> Setup -> Product Family
    Please help.
    Thanks,
    KM

    2 months ago, you asked a very similar question... and Markus gave you a good answer. His 2-months old answer still applies here.
    I recommend that you read it a again at Table name for backorder qty on sales order.
    When you have read his answer, please close both threads.

  • How can i get difference in base plan and actual/current plan for a project

    Hi PS Experts,
    How can i get difference in base plan and actual plan .
    For example-
    Project1 is created for 10 days (start and end date difference).
    Now in between -project is extended/changed for 12 days .
    What is the way to get 2 days as a difference in base plan and current plan.
    Thanks
    Suraj prakash

    Hi Suraj,
    You can follow a convention that -
    (1) Forecast Start/Finish dates: Used only for Primary planning, once initial planning is done you should not change these dates.
    Now, you will copy the same dates in Basic Start/Finish dates also.
    (2) Basic Start/Finish dates: Whatever changes are done after the initial planning, you will make the changes only in Basic Start/Finish dates.
    So, in Project Planning board, if you enable Forecast and Basic dates with different color coding, you can clearly see the variation in the Project schedule.
    Hope this helps.

  • Base method and base value

    Dear forum,
    I would like to seek advice on the above.
    I do not sure what is the difference between base method and base value in multilevel method.
    What is the difference between these 2 base?
    Thanks

    Hi,
    If you go ti AFAMA nd chosse a depr, key you can see the base Method as one component of the key.
    Here is defined:
    - Type of depreciation
    - Dep. method and
    - Treatment of end of depreciaion
    If you take a look at the "multilevel method (also in AFAMA) you can see the base value.
    The value used as the basis for the calculation of depreciation.
    Regards Bernhard

  • Need Script To anaylize Table And Index

    Hi,
    I need to write a Procedure where I will pass schema Name as parameter and procedure will analyze all table and its Index
    Regards

    user2014538 wrote:
    Hi,
    I need to write a Procedure where I will pass schema Name as parameter and procedure will analyze all table and its Index
    Regardsfor V10+ Oracle RDBMS, default behavior is to collect "needed" statistics once every 24 hours.
    Therefore you do not need to do anything else/special.

  • I have a presentation to make to a customer and need to know how many educational apps are there for the iPad/iPod?

    I have a presentation to make to a customer and need to know how many educational apps are there for the iPad/iPod? More specifically special education apps.
    Thanks

    Keep in mind as well that not all apps are "created equal".  Some are really good, and others are not very good.  You might also want to look at some education sites for recommendations.  An example of a general iPads in education forum is
    http://ipadeducators.ning.com/
    but I imagine some exist for special education needs as well.  Our healthcare organization is using some apps for working with autistic children and find them very helpful. 

  • Finding source database table/column name for a column in a view

    Hi i need to be able to identify the original database table/column name for a column in a view.
    e.g. say i have a view like this
    create v1 as select a.name fname, b.name bname, c.name cname,......
    from u1.names a, u2.names b. u3.names c
    where .....
    Now I want to find out that the database table/column name for the fname, bname and cname columns in the view v1, which in this instance is u1.name.name, u2.names.name, u3.names.name.
    But i need to be able to do it for any view. Short of parsing the SQL is there an easy way of doing this?
    Now obviusly I can't do this for virtual columns but I will know my column is not virtual as it has an index on it.

    But i need to be able to do it for any view. Short of
    parsing the SQL is there an easy way of doing this?No, parsing the SQL is the only way. Good luck it is not something I would want to attempt.

  • I need to know how to size a media server for 800-1200 user

    i need to know how to size a media server for 800-1200 user

    Please clarify what you mean. Do you already have an iPhone? If so, and it came from the US and is (presumably) carrier locked, you're out of luck. NONE of the US carriers will unlock iPhones. There are no exceptions.
    The unlocked iPhone 4S is not yet available in US Apple retail stores. All phones sold at retail in the US are currently carrier locked.

  • I recently had a kernel panic in which I think my hard drive only had so much space left after I ran a bunch of drivers I thought I needed. I uninstalled all and moved files. For some odd reason I'm not getting sound of of my hdtv/monitor.HELP?

    I recently had a kernel panic in which I think my hard drive only had so much space left after I ran a bunch of drivers I thought I needed. I uninstalled all and moved files. For some odd reason I'm not getting sound of of my hdtv/monitor.HELP? I uninstalled all the drives and apps I download. I moived files either to trash if not needed, and others to other external drives. I went into disk utility and did a repair disk permission and verify disk. Clean out junk files. Now my hdtv/monitor does not give me any sound, nor does my mac mini. Can someone please tell me what to do?

    What drivers?

  • Hi, we need to create the test environment from our production for oracle AP Imaging. we have soa,ipm,ucm and capture managed servers in our weblogic. can anyone tell me what is the best way to clone the environment, can I just tar the weblogic file syste

    Hi, we need to create the test environment from our production for oracle AP Imaging. we have soa,ipm,ucm and capture managed servers in our weblogic..
    Can anyone tell me what is the best way to cloning the application from different environment, the test and production are in different physical server.
    Can I just tar the weblogic file system and untar it to the new server and make the necessary changes?
    Can anyone share their experiences and how to with me?
    Thank in advance.
    Katherine

    Hi Katherine,
    yes and no . You need as well weblogic + soa files as the database schemas (soa_infra, mds...).
    Please refer to the AMIS Blog: https://technology.amis.nl/2011/08/11/clone-your-oracle-fmw-soa-suite-11g/
    HTH
    Borys

Maybe you are looking for