SQL to list out all objects (tables) that refrence to a table addicted.

Hi all -

I want to write a SQL that lists all objects (tables) that refrence for a table given.

For example

Say B Table refrence to A.col1 and Ref table C in table A.col2 table

Now I want a SQL which happens after output: -.

TABLE referenced by column
A B.col1 B
A C.col4 C



Thank you!!!

This also includes the owner and the costraint_name

select aco.owner, aco.table_name, ac.constraint_name, ac.table_name, acc.column_name
  from all_constraints ac,
       all_constraints aco,
       all_cons_columns acc
 where ac.owner=acc.owner
   and ac.constraint_name=acc.constraint_name
   and aco.owner=ac.r_owner
   and aco.constraint_name=ac.r_constraint_name
   and ac.constraint_type='R'

Tags: Database

Similar Questions

  • Is there a way to get a list of all applications / updates that are cached on your server?

    Is there a way to get a list of all applications / updates that are cached on your server?  Of course, we see the space that contains each category.  But I would like a detailed list of the individual items that are actually cached.

    ITD be even better if I could get a scoreboard that showed me how many times a particular point was served to customers.

    Yes.  But you need a little magic Terminal to get the desired data.  Caching server is managed by a sqlite database.  To examine the contents, follow these basic steps:

    1: connect to the database using the following command:

    sudo sqlite3 /Library/Server/Caching/Data/AssetInfo.db

    2: to structure the data, run these two commands to the sqlite command-line prompt:

    .blog column

    . Headers on

    3: to find everything that is stored, run this command (you'll get iCloud cached documents, books, iOS apps, etc.):

    Select * from ZASSET;

    4: to narrow the results down to elements called by software updates, try this:

    Select * from ZASSET where ZURI as "content %";

    You could get a line that looks similar to the following:

    403 2 6 0 2012986793 474949928.477396 476912032.644505 e03448847909547fb8c7d4ecd5a7b6dd FAB32A72-DE33-469D-A7DF-3CE1A1F9A4D2 on Wednesday, August 5, 2015 18:00:30 GMT

    / Content/downloads/42/44/031-30888/bhrkylcnycxmtug9daw3g4magqb7dl7hba/OSXUpdComb o10.1

    (added the newline for readability)

    It is an OS X Combo update.  It is located on the drive to library/server/cache/Data/FAB32A72-DE33-469D-A7DF-3CE1A1F9A4D2 / the file is probably named 0, but if you want to use it, just add at the end of the .pkg file.

    I hope this helps.  Put server cache saves a lot of data.

    Oh, to quit the sqlite command line tool, simply type .quit and press return.

    Reid

    Apple Consultants Network

    Author - "El Capitan Server - Foundation Services.

    Author - "El Capitan Server - Collaboration & control»

    Author - "El Capitan Server - Advanced Services '.

    : IBooks exclusively available in Apple store

  • Where can I find a list of all environment variables that can be used in the getenv() function?

    Hello

    I tried to find a list of all the environment variables to the OM of InDesign, alas, without success. I have already stumbled on what follows.

    $.getenv ('computername');

    $.getenv ('username');

    Even in the wonderful Jongware of object model (Adobe InDesign CS5 (7,0) object model JS: Table of contents) there is no information on that.

    I am looking for reference library containing these values. I have no specific in mind script task.

    Any help much appreciated!

    Olli

    You answer me here. In the good old Wikipedia there is a page on this. Check it out:

    Environment variable - Wikipedia, the free encyclopedia

  • a list of all the tables, columns and their consntraints in the database

    Hello

    I need to write sql code which considers a list of all tables in the database, their columns and the primary or foreign key for each column (if any) and the refrence for each foreign key column.

    Any ideas how ro?

    DROP TABLE table_b;
    DROP TABLE table_a;
    --
    CREATE TABLE table_a (
     CONSTRAINT pk_table_a PRIMARY KEY (column_b)
    ,column_a INTEGER
    ,column_b INTEGER
    );
    --
    CREATE TABLE table_b (
     column_c INTEGER
    ,column_d INTEGER CONSTRAINT fk_table_a REFERENCES table_a(column_b)
    );
    --
    
    SELECT  utc.table_name
           ,utc.column_name
           ,CASE WHEN uc.constraint_type = 'P' AND position IS NOT NULL THEN uc.constraint_name END primary_key
           ,CASE WHEN uc.constraint_type = 'R' AND position IS NOT NULL THEN uc.constraint_name END foreign_key
           ,CASE WHEN uc.constraint_type = 'R' AND position IS NOT NULL THEN uc.r_constraint_name END referenced_key
    FROM    user_tab_cols utc
            LEFT JOIN user_constraints uc
              ON  (utc.table_name = uc.table_name)
            LEFT JOIN user_cons_columns ucc
              ON(ucc.table_name = utc.table_name
                   AND utc.column_name = ucc.column_name
                   AND uc.constraint_name = ucc.constraint_name)
    WHERE   utc.table_name IN ('TABLE_A','TABLE_B');
    

    TABLE_NAME COLUMN_NAME PRIMARY_KEY FOREIGN_KEY REFERENCED_KEY

    TABLE_A COLUMN_B PK_TABLE_A

    TABLE_A COLUMN_A

    TABLE_B COLUMN_D FK_TABLE_A PK_TABLE_A

    TABLE_B COLUMN_C

    If you want to 'improve' the referenced_key column for the column referenced actually, you need to join user_cons_colums once again and use the column position.

    Concerning

    Marcus

  • Can XPS 410 - we have a list of all THE processors that are compatible from the Bios DXP061-020501

    I know I know, this has been asked several times on the forums. The problem is that is scattered between so many threads and I'd like to see in one place a list of all CPU that work on the XPS 410 from the current version of Bios DXP061-020501 compatable. It would be nice for a forum mod to publish a complete list of processors supported and then perhaps same sticky it.
     
    Thanks in advance
    Dave

    Message edited by dcgtls on 05/09/2007 22:55


  • Conversion of ore.list in an object table Oracle DB

    Hello

    I would like to know if there is a way to convert an array object ore.list and store it in the database? After using ore.groupApply (), we get the output grouped by a column 'Region '. I need to store it as a table in the Oracle database. In addition, I get error when using rqGroupEval().

    I tried to use 2 methods below:

    Method1: Embedded Script R - Interface D - used the script below

    modlist <-ore.groupApply)

    X = OOS_AGGR_FACT,

    INDEX = OOS_AGGR_FACT$ PEP_REGION_ASM,.

    {function (DAT)}

    MOD <-lm (OOS_LOST_DOLLARS ~ DAY_OF_WEEK + STORE + PEP_BRAND + ITM_VELOCITY_CLUSTER + STR_VELOCITY_CLUSTER + OOS_REASON + DAYS_OF_SUPPLY, dat)

    PRD <-predict (mod, dat = newdata)

    PRD [As.Integer (rownames (PRD))] <-prd

    cbind (dat, PRED = prd)

    });

    Result: Back o/p in the form of ore.list. How to convert this table and stores it as a table in the database?

    Method2: Embedded Script R - SQL Interface

    (1) created a packages such as:

    create or replace package oos_pkg_1 as type rec is being rendered (VARCHAR2 'RECORD_DATE' (255), 'DAY_OF_WEEK' VARCHAR2 (255), 'STORE' VARCHAR2 (255), VARCHAR2 "PEP_REGION_ASM" (255), VARCHAR2 "PEP_BRAND" (255), VARCHAR2 "ITM_VELOCITY_CLUSTER" (255), VARCHAR2 "STR_VELOCITY_CLUSTER" (255), VARCHAR2 "OOS_REASON" (255), "DAYS_OF_SUPPLY", "OOS_LOST_DOLLARS" NUMBER); News from type is ref cursor return rec. end;

    (2) created a function like:

    create or replace function oosgroupeval_1

    (inp_cur, oos_pkg_1.cur,

    par_cur sys_refcursor,

    out_qry varchar2,

    grp_col varchar2,

    exp_txt varchar2)

    return the sys. AnyDataSet

    parallel_enable in pipeline (inp_cur hash partition ("PEP_REGION_ASM"))

    cluster inp_cur by ("PEP_REGION_ASM")

    using rqsys.rqGroupEvalImpl;

    (3) finally used the R script below:

    Start

    sys.rqScriptDrop ('OOS_LD_Prediction');

    sys.rqScriptCreate ('OOS_LD_Prediction',

    "{function (dat, datastore_name)}

    MOD <-lm (OOS_LOST_DOLLARS ~ DAY_OF_WEEK + STORE + PEP_REGION_ASM + PEP_BRAND + ITM_VELOCITY_CLUSTER + STR_VELOCITY_CLUSTER + OOS_REASON + DAYS_OF_SUPPLY, dat)

    PRD <-predict (mod, dat = newdata)

    PRD [As.Integer (rownames (PRD))] <-prd

    RES <-cbind (dat, PRED = prd)

    }');

    end;

    /

    Select *.

    table (OOSGROUPEVAL_1)

    cursor (select day_of_week, store, pep_region_asm, pep_brand, itm_velocity_cluster, str_velocity_cluster, oos_reason, days_of_supply, oos_lost_dollars

    of oos_aggr_fact).

    cursor (1 select as "ore.connect", "LP" as "datastore_name" of the double).

    ' select day_of_week, store, pep_region_asm, pep_brand, itm_velocity_cluster, str_velocity_cluster, oos_reason, days_of_supply, oos_lost_dollars, 1 PRED

    to oos_aggr_fact ',

    "PEP_REGION_ASM,"

    'OOS_LD_Prediction'));

    Result: Error like below

    Error in "contrasts <-' (' * tmp *', value = contr.funs [1 + isOF [nn]]):

    contrasts can be applied only to drivers with 2 or more levels

    Can you get it someone please let me know if I am missing something in the above 2 methods?

    Namrata

    In ore.groupApply, use the PLEASURE. VALUE as a model for the return value.  Example: similar to your ore.groupApply using the iris of build-in data frame

    # Send data frame iris to IRIS database table

    Ore.Create (iris, "IRIS")

    test<- ore.groupapply(iris,="">

    {function (DAT)}

    #library (ORE)

    # ore.connect ("rquser", "main", "localhost", "rquser", all = TRUE)

    species<->

    MOD<- lm(sepal.length="" ~="" sepal.width="" +="" petal.length="" +="" petal.width,="">

    PRD<- predict(mod,="" newdata="">

    PRD [As.Integer (rownames (PRD))]<->

    Data.Frame (species = species,

    PRED = prd,

    stringsAsFactors = FALSE)

    },

    fun. VALUE =

    Data.Frame (species = character(),

    PRED = numeric(),

    stringsAsFactors = FALSE),

    parallel = TRUE)

    # Save the results in the TEST database

    Ore.Create ("TEST" test)

  • Script: Lists of all the indexes that benefit from regeneration

    Hello

    I have a few problems to MyOracleSupport to get the "Script: lists all indexes that benefit of a rebuild". 122008.1 told me it's expired and I have to use " " NOTE: 989186.1 ". But when I click the link I get only failure that it can't find the site.

    I'm using Firefox 3, maybe that's a problem? Maybe someone can point out the script?

    Greetings from the Germany

    No, 989186.1 of the Note is NOT available on MOS. the note number provided in 989093.1 is fake or it has been deleted.

    Hemant K Collette

  • Where can I get a list of all the updates that are available for windows 7 as well as a description of each

    I was wondering if anyone can give me a link to find all updates any importance that microsoft has come out for windows 7 and a description of each of them.

    Security bulletins: http://www.microsoft.com/technet/security/current.aspx

    Previous summaries: http://www.microsoft.com/technet/security/bulletin/summary.mspx

    Catalog: http://catalog.update.microsoft.com/v7/site/Home.aspx

    How to download drivers and updates from the Windows Update Catalog or the Microsoft Update Catalog
    http://support.Microsoft.com/kb/323166

    TaurArian [MVP] 2005-2011 - Update Services

  • Find out all the fmb that include a pll.

    I have a few hundreds of forms.
    And a specific library.

    Is there an easy way to quickly identify the fmb having this particular pll attached?
    I don't want to open them in Report Builder, and then click libraries and scan for my library...

    Thank you
    Toon

    Published by: Toon Koppelaars on February 16, 2010 11:13

    Toon,

    I suggest to rename your file pll and batch then recompile all your forms.

    Forms that don't compile should be those who have the attached pll.

    Or there are the forms API / ORCL Toolbox / Caffo / etc looking for tools.

  • List of all the calls that I made

    Hello everyone.
    I have a request, I hope someone will replay and advice me...
    I need a list of Skype calls I have with one of my contacts...
    To whom should I address my request?

    Well, I hope it will be useful

    https://support.Skype.com/en/FAQ/FA3171/how-can-i-view-my-call-history

  • I'm looking for all the cards that have a VIEW as the target object.

    Environment:

    OWB Tahoe development Version 11.2.0.1 Client on Windows 7
    Repositories on Oracle EE 11.2 on AIX

    Is there a way via the repository tables or OMB (shudder!) to get a list of all the cards that have a VIEW that the target object?

    Thank you very much!!

    -gary

    Try this:

    Re: How metadata repository OWB mapping?

    **************
    (1) log under user OWBSYS
    (2) run a procedure owbsys.wb_workspace_management.set_workspace

    exec owbsys.wb_workspace_management.set_workspace ('', '');
    (3) now the public view contains rows
    (4) at the end of the work to perform the owbsys.wb_workspace_management.unset_workspace procedure

    exec owbsys.wb_workspace_management.unset_workspace ();

    *************

  • Satellite A305-SP6803 - I need a list of all drivers

    I need to format my laptop Satellite * A305-SP6803 *, but I need a list of all the drivers that must be installed and if there are any installation order.

    Please help me with this information. Thank you.

    Freddy

    Hello

    Satellite A305-SP6803 is designed for the American market and the Toshiba page contains us all the necessary drivers.

    I think that the installation order it is not the main problem
    If you want to install the Toshiba drivers then I recommend starting with main driver chipset drivers, display driver sound driver LAN/Wlan, touchpad driver, etc.
    After you have installed current drivers, you could start with Toshiba tools such as package VAP (for Vista).

    See you soon

  • How to list all the tables that have no data

    Hi all


    I want to list all the tables that have no data. (registration number is 0)

    Someone help me.

    Thank you
    Thiensu2810

    Select owner, table_name from dba_tables where num_rows = 0;

    This assumes that the table statistics are COMMON.

  • Need urgent help to run the PL/SQL function when executing is having IN OUT type of table.

    Created under object types.

    (1) CREATE OR REPLACE TYPE INVENTORY_ITEM_ID_TAB IN THE TABLE OF THE NUMBER;

    --

    (2) CREATE OR REPLACE TYPE ITEM_TYPE_REC AS OBJECT (ITEM_ID ISSUE

    , ITEM_VALUE VARCHAR2 (4000)

    );

    --

    (3) CREATE OR REPLACE ITEM_TYPE_TAB AS TABLE ITEM_TYPE_REC;

    The function code

    FUNCTION XXqp_get_pts_model)

    p_item_id_tab IN INVENTORY_ITEM_ID_TAB)

    RETURN ITEM_TYPE_TAB

    IS

    l_ITEM_TYPE_TAB ITEM_TYPE_TAB: = ITEM_TYPE_TAB();

    ln_org_id NUMBER;

    BEGIN

    L_ITEM_TYPE_TAB. DELETE;

    l_ITEM_TYPE_TAB. EXTEND;

    LN_ORG_ID: = FND_PROFILE. VALUE ("QP_ORGANIZATION_ID");

    SELECT ITEM_TYPE_REC (EGO. INVENTORY_ITEM_ID,

    C_EXT_ATTR10)

    LOOSE COLLECTION l_ITEM_TYPE_TAB

    To ego_mtl_sy_items_ext_b ego.

    ego_fnd_dsc_flx_ctx_ext ag,

    fnd_descr_flex_column_usages atr

    WHERE ego.attr_group_id = ag.attr_group_id

    AND ag.descriptive_flex_context_code = atr.descriptive_flex_context_code

    AND ag.application_id = atr.application_id

    AND ag.descriptive_flex_context_code = 'XXEGO_PRICE_INFO. '

    AND atr.end_user_column_name = 'XXEGO_PLAN_TO_SELL. '

    AND IN ego.inventory_item_id

    (SELECT

    (SELECT inventory_item_id

    OF MTL_SYSTEM_ITEMS_B

    WHERE segment1 = A.item_name

    AND organization_id = ln_org_id

    ) inventory_item_id

    OF geqp_apl_pricelist_sku_tbl A

    )

    AND ego.organization_id = ln_org_id;

    RETURN l_ITEM_TYPE_TAB;

    end XXqp_get_pts_mode;

    Below the code works fine BUT when calling function in pl/sql dynamic mode it does not underneath.

    ---------------------------

    Labour Code

    ---------------------------

    DECLARE

    CURSOR c1 IS SELECT (SELECT inventory_item_id

    OF mtl_system_items_b

    WHERE segment1 = A.item_name

    AND organization_id = 83

    ) INVENTORY_ITEM_ID

    of XXqp_apl_pricelist_sku_tbl;

    L_INVENTORY_ITEM_ID_TAB INVENTORY_ITEM_ID_TAB: = INVENTORY_ITEM_ID_TAB();

    L_ITEM_TYPE_TAB ITEM_TYPE_TAB: = ITEM_TYPE_TAB();

    LV_CHAR VARCHAR2 (1000);

    LV_QRY VARCHAR2 (1000);

    BEGIN

    --

    l_inventory_item_id_tab. DELETE;

    OPEN c1;

    LOOP

    C1 FETCH BULK COLLECT INTO L_INVENTORY_ITEM_ID_TAB;

    OUTPUT WHEN c1% NOTFOUND;

    END LOOP;

    CLOSE C1;

    SELECT XXQP_APL_ELIG_TCA_DEV_PKG. XXQP_GET_PTS_MODEL (L_INVENTORY_ITEM_ID_TAB)

    IN L_ITEM_TYPE_TAB

    FROM DUAL;

    --

    FOR j IN 1.l_ITEM_TYPE_TAB. COUNTY

    LOOP

    DBMS_OUTPUT. PUT_LINE (L_ITEM_TYPE_TAB (J). ITEM_VALUE);

    END LOOP;

    END;

    ---------------------------

    Code does not

    ---------------------------

    DECLARE

    CURSOR c1 IS SELECT (SELECT inventory_item_id

    OF mtl_system_items_b

    WHERE segment1 = A.item_name

    AND organization_id = 83

    ) INVENTORY_ITEM_ID

    of GEqp_apl_pricelist_sku_tbl;

    LV_QRY VARCHAR2 (1500);

    L_INVENTORY_ITEM_ID_TAB INVENTORY_ITEM_ID_TAB: = INVENTORY_ITEM_ID_TAB();

    l_ITEM_TYPE_TAB ITEM_TYPE_TAB: = ITEM_TYPE_TAB();

    BEGIN

    l_inventory_item_id_tab. DELETE;

    OPEN c1;

    LOOP

    C1 FETCH BULK COLLECT INTO L_INVENTORY_ITEM_ID_TAB;

    OUTPUT WHEN c1% NOTFOUND;

    END LOOP;

    CLOSE C1;

    LV_QRY: = ' START: 1: = XXQP_APL_ELIG_TCA_DEV_PKG. XXQP_GET_PTS_MODEL(:2); END;';

    DBMS_OUTPUT. Put_line ('-> lv_qry' |) LV_QRY);

    IMMEDIATE EXECUTION in USING LV_QRY IN l_INVENTORY_ITEM_ID_TAB, OUT l_ITEM_TYPE_TAB;

    END;

    Kindly help me out here in the execution of the function from PL/SQL runtime which is having IN OUT type of table.

    Kind regards

    Devendra

    Wrong code

    IMMEDIATE EXECUTION in USING LV_QRY IN l_INVENTORY_ITEM_ID_TAB, OUT l_ITEM_TYPE_TAB ;

    When I use the code below, able to perform the function without any error.

    EXECUTE LV_QRY IMMEDIATELY WITH THE HELP OF THE L_ITEM_TYPE_TAB, IN L_INVENTORY_ITEM_ID_TAB;

    Thank you all for your help in fixing the code.

  • Remove a property of all objects in a table

    I have a relationship with a large number of custom properties added to objects in virtual machine earlier in the report.  Later in the report, I want to delete only a custom from the items property.

    Assuming that my table variable is $vms, how to remove a unique property of all objects of the virtual machine in the table?  (If possible, I prefer not to do another select statement and select only the properties that I want to keep, because it makes for a long select statement and makes the report less readable).

    Hello, TheVMinator-

    I guess that, 'do not add to start with the foreign custom property' is not a valid solution, as I assume that this custom property using one at a time.

    Another way would be to use another select statement, but without the need to explicitly list this long array of properties to select.  You can select essentially all properties _except_ "extraProperty0" with something like:

    ## for all of the output items, select all *Property types of members _except_ for the one named "extraProperty0"$arrMyOutputItems | %{    Select-Object -InputObject $_ -Property (Get-Member -InputObject $_ -MemberType *Property | ?{$_.Name -ne "extraProperty0"} | %{$_.Name})}
    

    This assumes that all of the properties that you want to 'keep' are of MemberType * property (so, NoteProperty, goods, etc.).  While this is another select statement, it avoids the part 'long list of properties to select' that you do not want.  How does do for you?

Maybe you are looking for