Tuesday, August 2, 2011

R12 Customer Query

/* R12 Customer Query */

SELECT DISTINCT *
FROM HZ_PARTIES CUST,
HZ_CUST_ACCOUNTS CUST_ACCT,
HZ_CUST_ACCT_SITES_ALL CUST_SITE,
HZ_CUST_SITE_USES_ALL CUST_USES,
HZ_LOCATIONS CUST_LOC
WHERE CUST_ACCT.CUST_ACCOUNT_ID = CUST_SITE.CUST_ACCOUNT_ID
AND CUST_SITE.CUST_ACCT_SITE_ID = CUST_USES.CUST_ACCT_SITE_ID
--AND CUST_USES.SITE_USE_ID = EXT_PAYER.ACCT_SITE_USE_ID
AND CUST_USES.LOCATION = CUST_LOC.LOCATION_ID(+)
AND CUST.PARTY_ID = CUST_ACCT.PARTY_ID
--AND PARTY_NAME LIKE '2%'
AND CUST_ACCT.CUST_ACCOUNT_ID = 20657 --(OE_ORDER_HEADERS_ALL.SOLD_TO_ORG_ID)

1 comment:

  1. /* Order Customer Query R12 */
    SELECT OOHA.ORDER_NUMBER,
    (SELECT DISTINCT PARTY_NAME
    FROM HZ_PARTIES CUST,
    HZ_CUST_ACCOUNTS CUST_ACCT,
    HZ_CUST_ACCT_SITES_ALL CUST_SITE,
    HZ_CUST_SITE_USES_ALL CUST_USES,
    HZ_LOCATIONS CUST_LOC
    WHERE CUST_ACCT.CUST_ACCOUNT_ID = CUST_SITE.CUST_ACCOUNT_ID
    AND CUST_SITE.CUST_ACCT_SITE_ID =
    CUST_USES.CUST_ACCT_SITE_ID
    --AND CUST_USES.SITE_USE_ID = EXT_PAYER.ACCT_SITE_USE_ID
    AND CUST_USES.LOCATION = CUST_LOC.LOCATION_ID(+)
    AND CUST.PARTY_ID = CUST_ACCT.PARTY_ID
    --AND PARTY_NAME LIKE '2%'
    AND CUST_ACCT.CUST_ACCOUNT_ID = OOHA.SOLD_TO_ORG_ID)
    CUSTOMER,
    OOLA.ORDERED_ITEM,
    OOLA.ORDERED_QUANTITY,
    OOLA.OPEN_FLAG,
    OOLA.BOOKED_FLAG,
    OOLA.FLOW_STATUS_CODE
    FROM OE_ORDER_HEADERS_ALL OOHA, OE_ORDER_LINES_ALL OOLA
    WHERE OOHA.HEADER_ID = OOLA.HEADER_ID
    AND OOHA.ORG_ID = OOLA.ORG_ID
    AND OOLA.INVENTORY_ITEM_ID = 1859

    ReplyDelete