Skip to main content

TCA QUERIES

The SQL queries involving following TCA tables are explained in the next section.

1. HZ_PARTIES
2. HZ_ORGANIZATION_PROFILES
3. HZ_PERSON_PROFILES
4. HZ_CUSTOMER_PROFILES
5. HZ_LOCATIONS
6. HZ_PARTY_SITES
7. HZ_PARTY_SITE_USES
8. HZ_CUST_ACCOUNTS
9. HZ_CUST_ACCT_SITES
10. HZ_CUST_SITE_USES
11. HZ_CONTACT_POINTS
12. HZ_ORG_CONTACTS
13. HZ_ORG_CONTACT_ROLES
14. HZ_RELATIONSHIPS
15. HZ_CLASS_CATEGORIES
16. HZ_CLASS_CODE_DENORM
17. HZ_CODE_ASSIGNMENTS
18. HZ_CLASS_CATEGORY_USES
19. HZ_RELATIONSHIP_TYPES

Query to fetch Organization party details.


  • When a new Organization is created, a record is created in the HZ_PARTIES table with PARTY_TYPE = ORGANIZATION. The HZ_PARTIES table holds the basic information about the party like party name, party number, party type etc.
  • Query based on party id. Party id is primary key in HZ_PARTIES.
           SELECT * 
              FROM hz_parties 
            WHERE party_id = <enter party id here> 
                  AND party_type = 'ORGANIZATION'
  • Query based on party number. Party number is stored in a VARCHAR type column. So, it should always be included in single quotes. Party number is unique for all the parties and will return a single row for one party number.
            SELECT * 
                FROM hz_parties 
             WHERE party_number = '<enter party number here>' 
                   AND party_type = 'ORGANIZATION'

  • Query based on party name. Multiple parties can have same name. Below query may return multiple rows depending on the party name.
            SELECT * 
               FROM hz_parties 
            WHERE party_name = '<enter party name here>' 
                   AND party_type = 'ORGANIZATION'


  • To find active parties, add join
             AND status = 'A'
  • To find inactive parties, add join
             AND status = 'I'
  • When a new Organization is created, a record is also created in HZ_ORGANIZATION_PROFILES table. The table holds more detailed and specific information about the organization like organization‟s finance history, bank, employees, etc. The primary key is ORGANIZATION_PROFILE_ID 
             SELECT * 
                FROM hz_organization_profiles 
             WHERE party_id = <enter party id here>
  • When a new Person is created, a record is created in the HZ_PARTIES table with PARTY_TYPE = PERSON. The HZ_PARTIES table holds the basic information about the party like party name, party number, party type etc.
           SELECT * 
              FROM hz_parties 
            WHERE party_name = '<enter party name here>' 
                  AND party_type = 'PERSON'
  • HZ_PARTY_SITES table relates an existing party from the HZ_PARTIES table with an address location from the HZ_LOCATIONS table. The table stores location-specific party information such as MAILSTOP and ADDRESSEE.
            SELECT hps.* 
                FROM hz_parties hp ,
                             hz_party_sites hps 
             WHERE hp.party_id = hps.party_id 
                   AND hp.party_id = <enter party id here>
  • Query to find addresses for a party.
            SELECT hl.* 
               FROM hz_parties hp ,
                            hz_party_sites hps ,
                            hz_locations hl 
            WHERE hp.party_id = hps.party_id 
                  AND hp.party_id = <enter party id here> 
                   AND hl.location_id = hps.location_id
  • Query to find accounts for a party.
           SELECT * FROM hz_cust_accounts WHERE party_id = <enter party id here>
          
             CUST_ACCOUNT_ID is primary key of the table.
  • Query to find customer account sites for a party.
           CUST_ACCT_SITE_ID is the primary key of the table.

            SELECT hcas.* 
               FROM hz_cust_accounts hca ,
                            hz_cust_acct_sites_all hcas ,
                            hz_parties hp 
           WHERE hp.party_id = <enter party id here> 
                 AND hca.cust_account_id = hcas.cust_account_id 
                 AND hp.party_id = hca.party_id

              OR
          SELECT hcas.* 
              FROM hz_cust_acct_sites_all hcas ,
                           hz_parties hp ,
                           hz_party_sites hps 
           WHERE hp.party_id = hps.party_id 
                  AND hp.party_id = <enter party id here> 
                  AND hcas.party_site_id = hps.party_site_id
  • Query to find business purposes (ship to, bill to etc) of account sites.
            SELECT hcsu.* 
               FROM hz_cust_accounts hca ,
                            hz_cust_acct_sites_all hcas ,
                            hz_cust_site_uses_all hcsu ,
                            hz_parties hp 
            WHERE hp.party_id = <enter party id here> 
                  AND hp.party_id = hca.party_id 
                  AND hca.cust_account_id = hcas.cust_account_id 
                  AND hcsu.cust_acct_site_id = hcas.cust_acct_site_id 
                  AND hcsu.site_use_code = '<enter site use here>'

           Site use code can be SHIP_TO, BILL_TO, SOLD_TO etc.
            
           SITE_USE_ID is primary key of the table.
  • Query to find contact points for a party/party site.
           SELECT * 
              FROM hz_contact_points 
             WHERE owner_table_name = 'HZ_PARTIES' 
                  AND owner_table_id = <enter party id here>
  • Query to find relationship between two parties.
            SELECT * 
               FROM hz_relationships 
            WHERE subject_table_name = 'HZ_PARTIES' 
                 AND object_table_name = 'HZ_PARTIES' 
                 AND relationship_type = <enter relationship type here>
  • Query to find Organization contacts.
             SELECT hoc.* 
                 FROM hz_org_contacts hoc ,
                              hz_relationships hr 
              WHERE hoc.party_relationship_id = hr.relationship_id 
                    AND hr.subject_id = <enter party id of party A> 
                    AND hr.object_id = <enter party id of party B>

Comments

Popular posts from this blog

Oracle Subledger Accounting (SLA) Tables, Views

Oracle Subledger Accounting (SLA) Tables, Views Oracle Subledger Accounting Tables: TABLE NAME DESCRIPTION XLA_AAD_GROUPS The XLA_AAD_GROUPS table stores the merge dependencies analyzed during the merge analysis.  All application accounting definitions with the same GROUP_NUM must be merged together. XLA_AAD_HDR_ACCT_ATTRS The XLA_AAD_HDR_ACCT_ATTRS stores standard, system and custom sources assigned to an accounting attribute at the AAD level. XLA_AAD_HEADER_AC_ASSGNS Store the analytical criteria for the application accounting definitions. XLA_AAD_LINE_DEFN_ASSGNS This table stores the journal lines definitions for the application accounting definitions. XLA_AAD_LOADER_DEFNS_T The XLA_AAD_LOADER_DEFNS_T table is the interface table that facilitates the data transfer from data files and the database. XLA_AAD_LOADER_LOGS The XLA_AAD_LOADER_LOGS table stores the errors and logs generated by the application accounting definitions loader. XLA_AAD_SOURCES XLA_AAD_SOURCES table stores a...

Public API’s for FA Transactions

Public API’s for FA Transactions So far Oracle FA is have all the good things except the lack on reporting.Oracle FA is now offer lot of public API's that can be used to interfacing with third party or Oracle application other modules. Here are some of transaction's API's:   Additions API if you have requirement to add assets directly via PL/SQL then use  FA_ADDITION_PUB.DO_ADDITION. If you have selected the Allow CIP Assets check box on the Book Controls window of a tax book when adding CIP assets using the Additions API, the this API automatically adds those CIP assets to that tax book at the same time that they are added to the corporate book. Adjustments API you can make cost adjustments to your assetsdirectly via PL/SQL using  FA_ADJUSTMENT_PUB.DO_ADJUSTMENT  for any  process adjustment. Detail can be found in appendix H) You can use this API if you have a custom interface that makes it difficult to use with the existing Oracle Assets interfaces for adjusti...

Unbilled Receivables and Unearned Revenue Accounting in Oracle Projects

Unbilled Receivables and Unearned Revenue Accounting in Oracle Projects Introduction When it comes to contractual billing, invoice and revenue generation are two separate processes, which during the lifespan of a project may or may not always coincide with each other and so do the balances in revenue and receivables accounts.  This interim difference between revenue and invoice account balances is bridged using Unbilled Receivables (UBR) and Unearned Revenue (UER) Accounts. Unearned Revenue (UER) Unearned Revenue (also termed as deferred revenue or UER) signifies money received for the goods or services, which are yet to be delivered.  As per the principles of Revenue Recognition, UER is recorded as on the balance sheet unless it is converted to Revenue upon delivery of goods or services For Example XYZ Consulting Ltd. receives an annual maintenance contract of $ 12,000 on Dec 31, 2014 for the period of Jan 01, 2015 to Dec 31, 2015. At the start of the contract as of Dec 31, 2...