将表链接到另一个表

时间:2019-04-25 04:13:48

标签: datamodel bi-publisher oraclereports oracle-sql-data-modeler

我正在oracle融合云中创建新的数据模型。我有一个不同的表,我想链接所有三个表。我该怎么办? 以下是我使用的表格:

doo_headers_all dha,
ra_terms rt,
ra_customer_trx_all rcta,
hz_cust_site_uses_all bill_hcsua,
hz_cust_acct_sites_all bill_hcasa,
hz_cust_accounts bill_hca,
hz_party_sites bill_hps,
hz_parties bill_hp,
hz_party_site_uses ship_hpsu,
hz_party_sites ship_hps,
hz_parties ship_hp,
hz_addtnl_party_names bill_hapn,
hz_addtnl_party_names ship_hapn

除DOO_HEADERS_ALL以外,我都链接了所有其他链接,我尝试搜索可以使用哪些外键,以便可以将其全部链接,但看不到任何答案。

rcta.term_id = rt.term_id(+)
and rcta.bill_to_site_use_id = bill_hcsua.site_use_id(+)
and bill_hcsua.cust_acct_site_id  = bill_hcasa.cust_acct_site_id(+)
and bill_hcasa.cust_account_id = bill_hca.cust_account_id(+)
and bill_hcasa.party_site_id = bill_hps.party_site_id(+)
and bill_hps.party_id = bill_hp.party_id(+)
and rcta.ship_to_party_site_use_id = ship_hpsu.party_site_use_id(+)
and ship_hpsu.party_site_id = ship_hps.party_site_id(+)   
and ship_hps.party_id = ship_hp.party_id(+)
and bill_hp.party_id = bill_hapn.party_id(+) and bill_hapn.party_name_type (+) = 'PHONETIC'
and ship_hp.party_id = ship_hapn.party_id(+) and ship_hapn.party_name_type (+) = 'PHONETIC'

这是我用来链接除doo_headers_all以外的其他表的

1 个答案:

答案 0 :(得分:0)

dha.ORDER_NUMBER = rcta.CT_REFERENCE(+)

dha.SOLD_TO_CUSTOMER_ID = bill_hca.CUST_ACCOUNT_ID (+)

这在很大程度上取决于您的设置。 还不清楚您所说的“不同的表,我想链接所有3个表”的含义,因为您的列表比3个表长很多。