Determining the relationship between 2 database tables

hi all,
is it possible to write a java program that can determine the relationship between 2 database tables, given only the database tables? can you provide examples please? thanks.

java.sql.DatabaseMetaData provides the methods ....Just as long as the relationships are simple and the database and driver are known. For example there is no way that it is going to be able to tell you about a trigger that connects two tables.

Similar Messages

  • How to find relationship between database tables

    Hi Mate,s.
    Iam new to SAPBW , PLZ tell me , How to find releationship between database table(Transperent tables).
    Regards.
    harry

    hi harry,
    from your previous postings, i guess you are asking relationship between tables in r/3, following links may help :
    http://www.sapgenie.com/abap/tables.htm
    http://www.sapgenie.com/abap/tables_sd.htm
    http://www.sapgenie.com/abap/tables_mm.htm
    http://www.sapgenie.com/abap/tables_fi.htm
    http://www.sapgenie.com/abap/tables_ps.htm

  • Technical Reference question: Relationship between WIP Tables & INV Tables

    Hi Community,
    Due to my profile is more closer to the Financials Area than the Manufacturing and Work In Process Area, I want to leave the following question in the community, in order to see if anybody can give me an answer.
    We want to modify a view created for its use in Discoverer. This view, retrieves the total number of units or kilograms that we have of all our items in all of our subinventory organizations, till submitted date. For all this itms, we want to know how many of them, and in which quantity should we depreciate them (is that to say, we categorized those items based on its antiquity in stock, to 6 months, 12 months, 18 months and more then 18 months). How we know the time range?, making a comparison between its last purchase date and its last sales date; and the result of that, with the submitted date.
    This logic, works fine for all items added to our stock as a result of a Purchase Order and a Sales Order, cause in both operations, we can get the purchase date and the sales date; but for all of our items that we manufacture in our manufacturing process, all those items appears in the Discoverer Report, totally depreciated; is that to say, with an antiquity grater than 18 months. And in some cases that is correct, cause there are materials and items in stock since beginning implementation and migration from the old system, but for a huge number of them that is not correct, cause its stock is "constantly" up and down based on the manufacturing process or because its components are all of them purchased by a Purchase Order, but the final item get as a result of the manufacturing process, does not have this purchase date (does not inherit the first or last purchase date from any of its components), cause the only date that we can retrieve is the production date (transaction date) when the item was created.
    So we want to include this production date in the logic of the query used to creation of the view which feed the discoverer report or to know the relationship between the WIP tables and INV tables (those where the items are reflected), in order to match the item, created in the manufacturing process, and the stock of that item in our subinventory organization.
    Thanks in advance for your help and assistance.
    Luis

    Hello Experts, One of the Interview I faced a scenario,I have two tables T1,T2 and i have access to oracle and informatica .How can i know the relationship between two tables?  Thankssirii

  • How would i design the relationship between "question", "subquestion", and "answer"

    Hi all. Consider the following scenario:
    Scenario:
    A Question has an Answer, but some Questions have Subquestions. For example:
    1. Define the following terms: (Question)
    a) Object (1 marks) (Subquestion)
    An instance of a class. (Answer)
    b) ...
    2. Differentiate between a constructor and a destructor (2 marks)
    (Question)
    A constructor constructs while a destructor destroys.
    (Answer)
    Question:
    I want to model Questions, Subquestion, and Answer as Entities with relationships/associations, preferably binary relationships as i feel ternary relationships will be problematic while programming. Any suggestion on how i would
    go about this?
    There is never infinite resources.
    For the Question Entity, a question has the attributes "QuestionPhrase <String>", "Diagram<Binary>", and "Marks
    <Decimal>".
    For the SubQuestion Entity, a subquestion has the attributes "SubQuestionPhrase <String>", "Diagram<Binary>", and "Marks <Decimal>".
    For the Answer Entity, an answer has attributes, "AnswerPhrase<String>", "Diagram <Binary>"

    Yes. I am in .Net. I sure do hope i did not ask in the wrong forum. :-|
    Hi KCWamuti,
    If you need to design the relationship between Question table and Answer table in SQL Server, as Uri’s and Visakh’s posts, you can create the foreign key to establish relationship between tables, and use join in query to get your desired result. For more
    information about JOIN in SQL Server, please review this article:
    Different Types of SQL Joins.
    However, if you need to model Questions, Subquestion, and Answer as Entities in .Net, then the issue regards data platform development. I suggest you post the question in the Data Platform Development forums at
    http://social.msdn.microsoft.com/Forums/en-US/home?category=dataplatformdev . It is appropriate and more experts will assist you.
    Thanks,
    Lydia Zhang

  • Relationship between two tables

    Hi,
    Can some one tell me how can i find the relationship between two tables in CRM. is there any transaction for the same. Is it possible to see the data model.
    Thanks
    Akila.R

    Hi Nishant ,
    Could you please explain brief about the Data relationship ......??
    I can see the Foreign Key & Check Table relation in se11 .
    Since I am in the Analysing phase ,
    what are all the details can i get from Foreign Key & Check table kind relations ...??
    Thanks
    Rgds
    Ganesh

  • The relationships and links between the various SAP database tables

    Hi Gurus,
    I am trying to learn the relationships and links between the various SAP database tables (SAP FI-AA, SAP SD, SAP MM, SAP HR and so on) for correctly extracting data from them. Especially I am expressing an interest in the SAP database tables on SAP FI-AA, SAP SD, SAP MM, SAP HR. Could somebody provide me with documentations about the relationships and links between them. I will be very grateful if somebody can provide me with links.
    Thanks and regards
    Sergey

    hi Sergey,
    try
    http://www.erpgenie.com/abap/tables.htm
    http://www.erpgenie.com/abap/tables_fi.htm
    http://abap4.tripod.com/SAP_Tables.html
    http://abap4.tripod.com/Finance_Tables.html
    http://www.auditware.co.uk/SAP/Extras/SAPTables.pdf
    hope this helps.

  • In which table we can find the relationship between Role id and Task id

    Hi Experts,
    In which table we can find the relationship between Role id and Task id in Cprojects.
    Thanks
    Subhaskar

    Hi Subhaskar,
    Apart from DPR_ENTITY_LINK , you can also get it from table DPR_PART.
    Please go through the below link
    http://wiki.sdn.sap.com/wiki/display/PLM/cProjectstablesin+SAP
    I hope this will help you.
    Regards,
    Rahul

  • How to create the relationship between ESSBASE 11 and DM in OBIEE11

    Hi Experts,
    I have one requirement that there is one property table named 'Store Master' in DW,and it contains a lot of attribute, such as Open Date, Close Date, IS 24 Hour etc.
    But another data source is essbase and based on this source, I create all reports.
    In ESSBASE, it has one dimension and hierarchy Location, and it has four level, Country(L1),Region (L2),Province(L3),Store(L4)
    So I want to know how to create the relationship between Location (ESSBASE) and Store Master (DM).
    I try to create one relationship in physical layer between Gen4,Location and Store, then drag the open date and close date into Location Dimension in BMM,then Presentation Layer.
    When I drag column 'Open Date' ,'Gen4,Location ' and 'Sales' into reports, it will generate the following error message:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 14020] None of the fact tables are compatible with the query request Dim Region.Store Open Date. (HY000)
    However, when I remove the column 'Open Date'. it will be ok.
    So what I missing the steps? Please help me. Thanks.

    >
    '2. Now, pull the 'Store' column from relational DB onto the Gen5, Location column from Essbase. This action now creates, two logical sources for your 'Store' column.'
    If the length from different data source is not same,such as 1001(DM),L_1001(ESSBASE), can I drag the 'Store' column from relational DB onto the Gen5, Location column from Essbase?
    I think it does not work.Right?Hi,
    I am not sure if you are talking about the length(as in varchar(128)) of the member value being different in different sources, or the member itself is different in both the sources.
    I am still assuming, that you are referring to the members not same in both the sources.If it is, the whole concept of federation is based on conforming dimensions. So, it needs that the same dimension information is present in both the sources and then only, you know we can analyze the numbers based on this dimension. So, either the dimension being different in both sources, or the members not present in both the dimensions might lead to incorrect numbers.
    So I select Store Attributes in relation DB and Location in ESSBASE in physical layer, then create the physical join, such as right("Hour Sales"."H_Sales".""."H_Sales"."Gen6,Location",4) = "Authorization".""."EDW"."T_EDW_MDM_STORE"."US_CODE", then drag the OPEN_DATE and CLOSE_DATE in relation DB to Location in ESSBASE in BMM,finially drag them into presentation layer.We create physical layer relationships, to send over the same relation to the underlying database during querying. So, creating a physical relationship between essbase cube and relation database would not help here.
    When you set up this federation, BI Server sends individual queries to each source and maps the conforming dimension members internally.
    Hope I was clear, and this helps.
    Thank you,
    Dhar

  • How to create the relationship between ESSBASE 11 and DM  in OBIEE 11G?

    Hi Experts,
    I have one requirement that there is one property table named 'Store Master' in DW,and it contains a lot of attribute, such as Open Date, Close Date, IS 24 Hour etc.
    But another data source is essbase and based on this source, I create all reports.
    In ESSBASE, it has one dimension and hierarchy Location, and it has four level, Country(L1),Region (L2),Province(L3),Store(L4)
    So I want to know how to create the relationship between Location (ESSBASE) and Store Master (DM).
    I try to create one relationship in physical layer between Gen4,Location and Store, then drag the open date and close date into Location Dimension in BMM,then Presentation Layer.
    When I drag column 'Open Date' ,'Gen4,Location ' and 'Sales' into reports, it will generate the following error message:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 14020] None of the fact tables are compatible with the query request Dim Region.Store Open Date. (HY000)
    However, when I remove the column 'Open Date'. it will be ok
    So what I missing the steps? Please help me. Thanks.

    >
    '2. Now, pull the 'Store' column from relational DB onto the Gen5, Location column from Essbase. This action now creates, two logical sources for your 'Store' column.'
    If the length from different data source is not same,such as 1001(DM),L_1001(ESSBASE), can I drag the 'Store' column from relational DB onto the Gen5, Location column from Essbase?
    I think it does not work.Right?Hi,
    I am not sure if you are talking about the length(as in varchar(128)) of the member value being different in different sources, or the member itself is different in both the sources.
    I am still assuming, that you are referring to the members not same in both the sources.If it is, the whole concept of federation is based on conforming dimensions. So, it needs that the same dimension information is present in both the sources and then only, you know we can analyze the numbers based on this dimension. So, either the dimension being different in both sources, or the members not present in both the dimensions might lead to incorrect numbers.
    So I select Store Attributes in relation DB and Location in ESSBASE in physical layer, then create the physical join, such as right("Hour Sales"."H_Sales".""."H_Sales"."Gen6,Location",4) = "Authorization".""."EDW"."T_EDW_MDM_STORE"."US_CODE", then drag the OPEN_DATE and CLOSE_DATE in relation DB to Location in ESSBASE in BMM,finially drag them into presentation layer.We create physical layer relationships, to send over the same relation to the underlying database during querying. So, creating a physical relationship between essbase cube and relation database would not help here.
    When you set up this federation, BI Server sends individual queries to each source and maps the conforming dimension members internally.
    Hope I was clear, and this helps.
    Thank you,
    Dhar

  • Multiple relationships between 2 tables in report model

    if i have 2 relationships between the same two tables. how do i use one over the other?
    for example, i have 2 tables order and ordeDate table , with the definition of:
    order table:
    orderid int,
    qty int,
    orderdate date)
    and orderDate table:
    (id int,
    endOfDay date,
    endOfMonth date)
    i created one relation ship as orderDate = endOfDay and anothe relationship as orderDate = endOfMonth. some of my reports would need to use the relationship between orderDate = endOfDay and the month end reports would need to use yhe relationship between
    orderDate = endOfMonth. How do I select one relationship over the other when building the report?
    Ideally the database should have been redesigned, which cannot be done at the moment as this will be done on the next project

    Your table design is completly wrong. I am now sure how you are maintaining OrderDate table. SQL Server is RDBMS. Without relation how will you pick those rows from Order table whose order date is equal exactly equal to datefield in OrderDate table. The
    only way is to derived endofDay and endofMonth in the select query directly. I understand endofMonth. But what is EndofDay ? And that too a date datatype ??
    You can run the below query but it will not return specific order date from order table,
    SELECT * FROM [ORDER] WHERE
    CONVERT(CHAR(10),ORDERDATE,101) IN (SELECT CONVERT(CHAR(10),endOfDay,101) FROM ORDERDATE)
    SELECT * FROM [ORDER] WHERE
    CONVERT(CHAR(10),ORDERDATE,101) IN (SELECT CONVERT(CHAR(10),endOfMonth,101) FROM ORDERDATE)
    Even if i JOIN the two table by orderdate and endofDay/endofMonth, we will not received specific orderDate. And this is becouse if your Order table contains multiple orderDate that are matching to either endofDay or endofMonth, the final output will contain
    multiple orderDate details. I don't think this is what you need. Therefore you need to modify the OrderDate table or provide us the definition for endofDay and endofMonth, and how are you maintaining.
    Regards, RSingh

  • What is the relationship between them?

    What is the relationship between the following concepts ?
    Java perssitence entities
    Coherence caches
    Database tables
    Which one can best represents database tables ?

    qkc wrote:
    What is the relationship between the following concepts ?
    Java perssitence entities
    Coherence caches
    Database tables
    Java persistence entities are usually stored in database tables.
    Coherence caches may or may not have a relationship with Java persistence entities. If you use a JpaCacheStore then your entities are mapped to cached values with the primary key of the entity serving as a cache key.
    Which one can best represents database tables ?Of course database tables can represent database tables the best.
    Best regards,
    Robert

  • The relationship between production order and purchase requistion After running MPS

    Dear Experts:
         I met a issue . My users want to know the relationship between production order and purchase requistion . In my company we create production order and  purchase req. by  running MRP. our operations are:
    1. T-CODE: MD41  create planned order .
    2. T-CODE: CO41 convert planned order to production order .
    3. T-CODE: MD15 convert planned order to purchase Requisition.
      but I can't  find the  relation of them. would you like to give me some advices? thank you very much.

    Hello
    On the standard MTS process there is no link between the requirement (STO) and the replenishment element (production order).
    See the below extraction from note 12955:
    There is no index that the system could use to determine which issue element (sales order, planning, reservation, dependent requirement, ...) is covered by a certain receipt element (purchase order, production order, purchase requisition, planned order, stock level ...).
    A production order, for example, can be created to cover several different requirements, even when you are using lot sizing procedure EX.
    You can use transaction MD09 or MD04to determine the pegged requirements, but they are calculated dynamically and there is not fixed link between requirement and receipt.
    BR
    Caetano

  • How to build "Greater/less or Equal" relationships between two tables?

    Hi,
    Is there any straightforward approachs to realize the following kind of relationships between two tables?
    Table1.process_end_date >= Table2.work_start_date and
    Table1.process_end_date <= Table2.work_end_date
    BTW, there's no common columns for these two tables to do simple joins (inner, outter...).
    Thanks.
    Regards,
    Qilong 

    Sure.
    Table.SelectRows filters a given table (in this case Table2) based on a function provided as the second argument.
    (table2Row) => is the start of our filter function. It defines a function that takes one argument, called table2Row. Each row of Table2 will be passed to this function. If the function returns true, the row will be kept. If the function returns false,
    the row will be filtered out.
    The right hand side of the => is the filter expression. Because we're adding the custom column to Table1, we can reference a field in the current row of Table1 using square brackets (e.g. [process_end_date]). To reference the fields in the current row
    of Table2, we have to index into the table2Row variable passed to our function (e.g. table2Row[work_start_date]).
    Hope that helps.
    Ehren

  • What the relationship between eul4_documents and eul4_objs

    we use discoverer administration to creat folder. then we create workbook in discoverer desktop from available folders . now i want to write a sql to show the the relationship between folder and workbook. as i know , i can find folder in table eul4_objs and workbook in table eul4_documents . but how to link them together?
    For example , i know folder A. how can i find the workbooks which created from folder A only by using SQL

    Hi,
    Instead of EUL5 use EUL4 in this query.
    select distinct doc_name, obj.obj_name folder_name, bas.ba_name
    from eul_us.eul5_documents doc
    , eul_us.eul5_elem_xrefs xref
    , eul_us.eul5_expressions exp
    , eul_us.eul5_objs obj
    , eul_us.eul5_ba_obj_links bol
    , eul_us.eul5_bas bas
    where xref.ex_from_id = doc.doc_id
    and doc.doc_name = &your_report
    and xref.ex_to_id = exp.exp_id
    and obj.obj_id = exp.it_obj_id
    and bol.bol_obj_id = obj.obj_id
    and bas.ba_id = bol.bol_ba_id
    Hope it helps you.
    Best Wishes,
    Kranthi.

  • How to give relationship between two tables with comon column with between oprator

    Hi Folks,
    I am using Sql Server 2008R2. I am getting a problem to establish relationship between two tables. 
    I have two Tables, 1.Inventory Details Table another one is Inventory Header Table.
    Inventory Details Table having a column Card No and inventory Header Table having columns  From card No and To Card No.
    I want to give relationship between these two tables with Card no. Could you please provide me the Sql Query.
    Your help would be greatly appreciated .
    Regards
    hasthi.
    email:[email protected]

    Hi Raju,
     We have two way that we can relate to the table either join or quality condition use following syntax/Query  for relating two tables 
    select * from Inventory_Details ID inner join  Inventory_Header IH on ID.CardNo between IH.FrmCardno and IH.ToCardNo
    or 
    Select * from  Inventory_Details ID ,Inventory_Header IH where ID.CardNo=IH.CardNo OrSelect * from  Inventory_Details ID ,Inventory_Header IH where ID.CardNo between IH.FrmCardno and IH.ToCardNo
    Hope this will help you 
    Niraj Sevalkar

Maybe you are looking for

  • Error using insertPages function - Acrobat X Standard

    Hi there! i hope you can help me, since Acrobat support avoids to help me because of OEM :/ I try to add several pages in a PDF using Javascript. I am getting the following message: NotAllowedError: Security settings prevent access to this property o

  • What is the best way to view images on an External Hard Drive?

    I have a Macbook Pro with the latest OS X Yosemite Can anyone tell me the best way to easily view thumbnail images on the external hard drive because at present I am having to open each folder and would ideally like to see all thumbnail images in sim

  • Are Content Filters available from Verizon for Apple iPhone 5c?

    I noticed that Verizon offers Content Filters for my kids' Apple iPhone 4, but one is not offered for the 5c.  Is that correct? If so, what are some good alternatives for a dad concerned about his son's access to the garbage on the interweb?

  • What is  purpose of CO Partner Update fied in OPJH - Define Order types

    Dear All                 Could U explain the Purpose of CO Partner Update fied in OPJH - Define Order types .In help it is explained as below  : In allocations within CO, a totals record is usually produced for each sender-receiver combination.  In o

  • Troubles with my Sat U300.

    Hi there, Problem I am experiencing is the following. When boot up laptop, it goes to Toshiba splash screen and no further.  Sometimes it will just boot up, go to Toshiba splash screen and then turns off.  Then press power button again, Toshiba splas