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

Create Accounting for a Payment generates errors 95333 and 95359

Create Accounting for a Payment generates errors 95333 and 95359 Error: 95333: A conversion rate does not exist to convert USD to AUD for the conversion type Corporate and conversion date 20-MAR-09 for line -25. Please use the Daily Rates form in General Ledger to enter a conversion rate for these currencies, conversion date and conversion type. 95359: There is no accounted amount for the subledger journal entry line. Please inform your system administrator or support representative that: The source assigned to the accounting attribute Accounted Amount has no value for extract line number 88547. Please make sure the source assigned to the accounting attribute Accounted Amount has a valid value, or assign a different source to this accounting attribute. Solution: 1. Specify a conversion rate for the currencies and conversion date mentioned in the error message 95333 Navigation under the General Ledger responsibility: Setup > Currencies > Currency Rates Manager > Daily Rates ...

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...

AP Table Relation Oracle Apps

AP Table Relation Oracle Apps ORACLE PAYABLE TABLE RELATION Source Table Dependent Table Condition AP_INVOICE_LINES_ALL AIL ZX_LINES_SUMMARY ZLS AIL.invoice_id = ZLS.trx_id and  ZLS.application_id  = 200 and  ZLS.entity_code  = 'AP_INVOICES' and  ZLS.event_class_code  in ('STANDARD INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS') and  AIL.summary_tax_line_id = ZLS.summary_tax_line_id AP_INVOICE_LINES_ALL AIL ZX_LINES ZL AIL.invoice_id = ZL.trx_id and  ZL.application_id  = 200 and  ZL.entity_code  = 'AP_INVOICES' and  ZL.event_class_code  in ('STANDARD INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS') and  AIL.line_number = ZL.trx_line_number AP_INVOICE_DISTRIBUTIONS_ALL AID ZX_REC_NREC_DIST ZD AID.invoice_id = ZD.trx_id and  ZD.application_id  = 200 and  ZD.entity_code  = 'AP_INVOICES' and  ZD.event_class_code  in ('STANDARD INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS') and...