GROUP BY and ORDER BY help needed

I have got an sql query where I have the need to pull out the latest copy of duplicate info, but what is happening is that the first instance is being displayed. The query I have is this:
SELECT *
FROM tbl_maincontenttext
WHERE fld_menusection = 3
GROUP BY fld_webpage
ORDER BY fld_timedate DESC
Basically, I have content that is listed under menu section 3, but within that I will have several copies of content that will relate to a specific webpage (eg: about us). What is currently happening is that GROUP BY is obviously grouping the similarly named 'about us', but it is pulling the first record it comes across out of the database rather than the latest updated record.
As you can see, I am trying to get the query to order by fld_timedate which is a CURRENT_TIMESTAMP, but it's not working!
I'm hoping that there is some sort of SQL that I am unaware of that will help me group by and display the latest update/content.
Thanks.
Mat

It would help if you could show us the table definition. Your SQL statement is ambigous because you are selecting all table columns, yet only including one column in the group by clause.  A SQL statement must contain all selected columns that are not aggregates. Most DBMS will return an error for this statement. Others that don't return an error will return unexpected results.

Similar Messages

  • Sqlserver query using Group by and Order by

    SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
    MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
    MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
    AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
    MIN(BILL_DETAIL.x_cost_rate) as COST_RATE,
    MIN(BILL_DETAIL.x_cost_total) as COST_TYPE,
    LISTAGG(BILL_DETAIL.objid, ',') WITHIN GROUP(ORDER BY BILL_DETAIL.objid) as ID_LIST
    FROM table_x_gsa_bill_detail BILL_DETAIL
    WHERE (1=1)
    GROUP BY (DECODE(BILLABLE_YN, 1, 'Billable', 'Non-Billable') || ',' || BILLABLE_TO || ',' || DETAIL_CLASS || ',' || COST_TYPE || ',' || BILL_RATE)
    ORDER BY DECODE(BILLABLE_YN, 1, 'Billable', 'Non-Billable') || ',' || BILLABLE_TO || ',' || DETAIL_CLASS ||
    ) dt WHERE rn BETWEEN 0 AND 1
    Can any one pls help me using of Case Condition keyword instead of Decode in the above query ??? iam not able to convert above query for group by and order by..
    Actually i need to do group by the aggragate values which i got the values from the fields of BILLABLE_YN,BILLABLE_TO,DETAIL_CLASS, COST_TYPE, BILL_RATE.
    where as in oracle i can run above query using decode keyword where as in sqlserver iam not able to use BILLABLE_YN field alias of above query in group by .
    i tried like by using following way but it is wrong because here iam not using aggragate values of fields in group by funtion please help me in converting query in sqlserver. GROUP BY (case BILLABLE_YN when 1 then 'Billable' when 0 then 'Non-Billable' else
    'Non-Billable' End BILLABLE_YN + ',' + BILLABLE_TO + ',' + DETAIL_CLASS + ',' + COST_TYPE + ',' + BILL_RATE)
    Krishna

    CREATE TABLE DETAIL
    ([objid] int,[x_billable_to] varchar(19), [x_bill_quantity] int,
    [x_billable_yn] int, [x_bill_rate] int, [COST_TYPE] varchar(19) )
    INSERT INTO
    DETAIL
    ([objid], [x_billable_to], [x_bill_quantity], [x_billable_yn], [x_bill_rate],[COST_TYPE])
    VALUES
    (1, 'Customer', 3, 1, 20,'Parking'),
    (2, 'Customer', 1, 1, 25,'Toll'),
    (3, 'Customer', 2, 1, 20,'Parking') 
    Pls convert following query for executing query in sqlserver  ..for the column ID_List it should return data like 1,2,3
    SELECT * FROM (SELECT 1 rn,
            SUM(BILL_DETAIL.x_bill_quantity)      as BILL_QUANTITY,
            MIN(BILL_DETAIL.x_billable_to)        as BILLABLE_TO,
            MIN(BILL_DETAIL.x_billable_yn)        as BILLABLE_YN,
            AVG(BILL_DETAIL.x_bill_rate)          as BILL_RATE,
            LISTAGG(BILL_DETAIL.objid, ',') WITHIN GROUP(ORDER BY BILL_DETAIL.objid) as ID_LIST
         FROM   BILL_DETAIL
          WHERE (1=1)
     GROUP BY (DECODE(x_billable_yn, 1, 'Billable', 'Non-Billable') + ',' + x_billable_to  +  ',' + COST_TYPE + ',' + x_bill_rate)
          ORDER BY DECODE(x_billable_yn, 1, 'Billable', 'Non-Billable') + ',' + x_billable_to  +  ',' + COST_TYPE + ',' + x_bill_rate
           )dt 
    WHERE rn BETWEEN 0 AND 1
    Krishna
    sounds like this
    SELECT *
    FROM
    SELECT 1 rn,
    SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
    MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
    MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
    AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1) AS ID_Listing
    FROM BILL_DETAIL bd
    CROSS APPLY (
    SELECT BILL_DETAIL.objid + ',' AS [text()]
    FROM BILL_DETAIL
    WHERE objid = bd.objid
    FOR XML PATH('')
    )bd1(ID_LIST)
    WHERE (1=1)
    GROUP BY (CASE WHEN x_billable_yn = 1 THEN 'Billable' ELSE 'Non-Billable'END + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate),
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1)
    ORDER BY (CASE WHEN x_billable_yn = 1 THEN 'Billable' ELSE 'Non-Billable'END + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate),
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1)
    )dt
    WHERE rn BETWEEN 0 AND 1
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Group by and order by clause

    Hi,
    I have wriiten the below query and i am using group by and order by clause....but i am not getting the required result
    SELECT b.ACCOUNT_REGION,CASE WHEN b.product_reference_status='Reference' THEN 'Recruited' WHEN b.product_reference_status in ('Inactive','Declined') THEN 'Inactive' WHEN b.product_reference_status ='Nominate' THEN 'Inprogress' ELSE 'Other' END product_reference_status, COUNT(decode(b.product_quarter,'Q1FY09',b.REFERENCE_ID)) Q1FY09, COUNT(decode(b.product_quarter,'Q2FY09',b.REFERENCE_ID)) Q2FY09, COUNT(decode(b.product_quarter,'Q3FY09',b.REFERENCE_ID)) Q3FY09, COUNT(decode(b.product_quarter,'Q4FY09',b.REFERENCE_ID)) Q4FY09, COUNT(decode(b.product_quarter,'Q1FY10',b.REFERENCE_ID)) Q1FY10, COUNT(decode(b.product_quarter,'Q2FY10',b.REFERENCE_ID)) Q2FY10, COUNT(decode(b.product_quarter,'Q3FY10',b.REFERENCE_ID)) Q3FY10, COUNT(decode(b.product_quarter,'Q4FY10',b.REFERENCE_ID)) Q4FY10, COUNT(b.product_quarter) Total
    FROM refdump a, ref_dh_pr b
    WHERE A.REFERENCE_ID=b.REFERENCE_ID AND (b.CREATED_ON - NVL(a.REFERENCE_DATE,a.CREATED))>15 group by b.account_region,product_reference_status order by 2
    output is as given below
    Region Status Count
    LAD     Inactive     0
    EMEA     Inactive     21
    *APAC     Inactive     2
    *APAC     Inactive     1
    EMEA     Inactive     2
    EMEA     Inprogress     220
    LAD     Inprogress     19
    LAD     Other     2
    LAD     Other     0
    LAD     Other     5
    LAD     Recruited     182
    APAC     Recruited     191
    My question is
    1) Why i am geeting two APAC regions and 3 LAD (marked *) regions when i have grouped by region and status
    2) How can i make the status in the following order
    a) Recruited
    b)Inprogress
    c)Inactive
    d)Other
    Thanks,

    <i>group by b.account_region,product_reference_status</i>
    Just take all the columns in the group by clause in your select segment and run the SQL, you'll come to know abt the different values in columns which group together.
    *009*

  • Execution order - group by and order by

    is there any execution order when we use group by and order by together in single query ?

    BOL: "Logical Processing Order of the SELECT statement
    The following steps show the logical processing order, or binding order, for a SELECT statement. This order determines when the objects defined in one step are made available to the clauses in subsequent steps. For example, if the query processor can bind to
    (access) the tables or views defined in the FROM clause, these objects and their columns are made available to all subsequent steps. Conversely, because the SELECT clause is step 8, any column aliases or derived columns defined in that clause cannot be referenced
    by preceding clauses. However, they can be referenced by subsequent clauses such as the ORDER BY clause. Note that the actual physical execution of the statement is determined by the query processor and the order may vary from this list.
    1. FROM
    2. ON
    3. JOIN
    4. WHERE
    5. GROUP BY
    6. WITH CUBE or WITH ROLLUP
    7. HAVING
    8. SELECT
    9. DISTINCT
    10. ORDER BY
    11. TOP"
    http://msdn.microsoft.com/en-us/library/ms189499.aspx
    Kalman Toth Database & OLAP Architect
    IPAD SELECT Query Video Tutorial 3.5 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Oracle 8i vs Oracle 9/10: Group by and order of returned rows

    Hello people,
    I've searched the forum for threads on this topic: the order of returned rows in queries which have a GROUP BY clause, and found out that Oracle states that GROUP BY clause does not guarantee that the order of returned rows will be the same every time nor the rows will be ordered someway. I've confirmed this information in the Oracle documentation for the GROUP BY clause for Oracle 9 and 10. But I couldn't find the same in the Oracle 8 documentation (SQL Reference), in which the GROUP BY clause section does not mention anything about the order of returned rows in queries which have a GROUP BY (except for something about using a GROUP BY and a HAVING clause together, which is not helpful in this situation).
    Besides, I have an Oracle training book: "Introduction to Oracle: SQL and PL/SQL" for Oracle 8, where the GROUP BY clause is said to perform a default ordering, here is the text:
    "By default, rows are sorted by ascending order of the columns included in the GROUP BY list. You can override this by using the ORDER BY clause".
    So, I need to find out if Oracle 8 GROUP BY clause did some kind of sorting over the returned rows as it is said in the training book and if this behavior changed in Oracle 9. And more important: where to look for to find documentation about this change.
    Thank you, guys, I really hope someone could help me with this.
    Fer.

    And this statement from Tom (taken from the link above) says more about why the sort (even when done because of group by) should not be relied upon:
    <quote from="asktom link above">
    and even when it does sort as a by product of its processing, the sort is a
    BINARY SORT, not your sort (with your language and character set)
    </quote>

  • XML Publisher nested grouping, sum and order by question

    Please help in nested group by, sum and order by question
    My Data look like this:
    <Header>
    <Line1>
         <Part Number></Part Number>
              <Component>
                   <Component1></Component1>
                   <Component1 Amount></Component1 Amount>
              </Component>
              <Component>
                   <Component2></Component2>
                   <Component2 Amount></Component2 Amount>
              </Component>
    </Line1>
    <Line2>
         <Part Number></Part Number>
              <Component>
                   <Component1></Component1>
                   <Component1 Amount></Component1 Amount >
              </Component>
              <Component>
                   <Component2></Component2>
                   <Component2 Amount ></Component2 Amount >
              </Component>
    </Line2>
    </Header>
    I want to print report which is:
    1. Group by part number, component and sum the amount for a part number/component
    2. Order by part number, component
    Here is rtf file for XML publisher report
    <?for-each-group:G_LINES;PART_NUMBER?>
    <?sort:G_LINES;PART_NUMBER;'ascending';data-type='text'?>
    <?if:BREAKDOWN_COUNT>0?>
    Part Number: <?PART_NUMBER?>     Quantity: <?sum (current-group()/SHIP_QTY)?>          Part Count:<?count(current-group()/PART_NUMBER)?>     Breakdown Count:<?count(G_BREAKDOWN/COMPONENT)?>
    <?for-each:current-group()?>
    <?for-each-group:G_BREAKDOWN;COMPONENT?>
    Component: <?COMPONENT?>          Price: <?COMPONENT_PRICE?>
    <?end-for-each?>
    <?end-for-each?>
    <?end if?>
    <?end-for-each?>
    If I add <?sort:G_BREAKDOWN;COMPONENT;'ascending';data-type='text'?> inside G_BREAKDOWN grouping it gives error.
    My XML data file
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.25.0 -->
    <NI_COMMERCIAL_INVOICE_XMLP>
    <LIST_G_HEADER>
    <G_HEADER>
    <COMM_INV_NUMBER>C/901000598</COMM_INV_NUMBER>
    <COMM_INV_VERSION_NUMBER>1</COMM_INV_VERSION_NUMBER>
    <SHIP_FROM_NAME>National Instruments Europe Corp.</SHIP_FROM_NAME>
    <SHIP_FROM_ADDR>H-4031, Debrecen, Hatar ut 1/A</SHIP_FROM_ADDR>
    <SHIP_FROM_CITY></SHIP_FROM_CITY>
    <SHIP_FROM_STATE></SHIP_FROM_STATE>
    <SHIP_FROM_POSTAL_CODE></SHIP_FROM_POSTAL_CODE>
    <SHIP_FROM_COUNTRY>Hungary</SHIP_FROM_COUNTRY>
    <SHIP_TO_NAME>National Instruments Corporation (NIEC)</SHIP_TO_NAME>
    <FORMATTED_SHIP_TO_ADDR>11500 N Mopac Expwy
    Austin, TX 78759-3504
    United States</FORMATTED_SHIP_TO_ADDR>
    <SHIP_TO_ADDR1>11500 N Mopac Expwy</SHIP_TO_ADDR1>
    <SHIP_TO_ADDR2></SHIP_TO_ADDR2>
    <SHIP_TO_ADDR3></SHIP_TO_ADDR3>
    <SHIP_TO_ADDR4></SHIP_TO_ADDR4>
    <SHIP_TO_CITY>Austin</SHIP_TO_CITY>
    <SHIP_TO_STATE>TX </SHIP_TO_STATE>
    <SHIP_TO_POSTAL_CODE>78759-3504</SHIP_TO_POSTAL_CODE>
    <SHIP_TO_COUNTRY>US</SHIP_TO_COUNTRY>
    <SHIP_TO_EMAIL_ADDR></SHIP_TO_EMAIL_ADDR>
    <BILL_TO_ORG_ID>807737</BILL_TO_ORG_ID>
    <SHIPPED_VIA>UPS</SHIPPED_VIA>
    <DELIVERY_TERM>DDU</DELIVERY_TERM>
    <TEXT_FILE_SEPARATOR></TEXT_FILE_SEPARATOR>
    <DELIVERY_COUNT>4</DELIVERY_COUNT>
    <HEADER_WAYBILL></HEADER_WAYBILL>
    <LIST_G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629769</DELIVERY_ID>
    <ORDER_HEADER_ID>1431282</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004434</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-387</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4565737</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>26818</INVENTORY_ITEM_ID>
    <PART_NUMBER>777459-23</PART_NUMBER>
    <PART_DESC>SCC-AI04, 2-CHANNEL ISOLATED ANALOG INPUT</PART_DESC>
    <PART_CUSTOM_DESC>SCC-AI04, Automatic Data Processing Plug-In Board</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8471.80.9000</HTS_CODE>
    <TARIC_CODE>8471.80.0000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>158</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>158</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>158</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>632</EXTENDED_PRICE>
    <UNIT_WEIGHT>.16</UNIT_WEIGHT>
    <NET_WEIGHT>.64</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/01 NIC</WAYBILL>
    <BREAKDOWN_COUNT>0</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE></BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE></BREAKDOWN_VALUE>
    <COMPONENT></COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE></COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO></COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629769</DELIVERY_ID>
    <ORDER_HEADER_ID>1431282</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004434</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-387</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579950</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>143949</INVENTORY_ITEM_ID>
    <PART_NUMBER>779475-01</PART_NUMBER>
    <PART_DESC>SCC-68 I/O CONNECTOR BLOCK WITH 4 SCC SIGNAL CONDITIONING MODULE SLOTS</PART_DESC>
    <PART_CUSTOM_DESC>SCC-68, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>DAQH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>144</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>10</ORIG_SHIP_QTY>
    <UNIT_PRICE>144</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>144</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>10</SHIP_QTY>
    <EXTENDED_PRICE>1440</EXTENDED_PRICE>
    <UNIT_WEIGHT>1.06</UNIT_WEIGHT>
    <NET_WEIGHT>10.6</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/01 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>50</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>10</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>20</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>1370</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629822</DELIVERY_ID>
    <ORDER_HEADER_ID>1425429</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004365</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-372</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579940</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>22643</INVENTORY_ITEM_ID>
    <PART_NUMBER>777687-20</PART_NUMBER>
    <PART_DESC>SCXI-1320 TEMPERATURE SENSOR TERMINAL BLOCK, CAST</PART_DESC>
    <PART_CUSTOM_DESC>SCXI-1320, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>82</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>1</ORIG_SHIP_QTY>
    <UNIT_PRICE>82</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>82</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>1</SHIP_QTY>
    <EXTENDED_PRICE>82</EXTENDED_PRICE>
    <UNIT_WEIGHT>.57</UNIT_WEIGHT>
    <NET_WEIGHT>.57</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/02 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>5</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>1</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>2</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>75</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629822</DELIVERY_ID>
    <ORDER_HEADER_ID>1427673</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004391</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-377</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579948</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>143949</INVENTORY_ITEM_ID>
    <PART_NUMBER>779475-01</PART_NUMBER>
    <PART_DESC>SCC-68 I/O CONNECTOR BLOCK WITH 4 SCC SIGNAL CONDITIONING MODULE SLOTS</PART_DESC>
    <PART_CUSTOM_DESC>SCC-68, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>DAQH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>144</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>13</ORIG_SHIP_QTY>
    <UNIT_PRICE>144</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>144</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>13</SHIP_QTY>
    <EXTENDED_PRICE>1872</EXTENDED_PRICE>
    <UNIT_WEIGHT>1.06</UNIT_WEIGHT>
    <NET_WEIGHT>13.78</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/02 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>65</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>13</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>26</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>1781</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2630021</DELIVERY_ID>
    <ORDER_HEADER_ID>1429687</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004410</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-383</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4578220</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>61816</INVENTORY_ITEM_ID>
    <PART_NUMBER>777687-14</PART_NUMBER>
    <PART_DESC>SCXI-1314 FRONT MOUNTING TERMINAL BLOCK</PART_DESC>
    <PART_CUSTOM_DESC>SCXI-1314, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>120</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>120</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>120</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>480</EXTENDED_PRICE>
    <UNIT_WEIGHT>.68</UNIT_WEIGHT>
    <NET_WEIGHT>2.72</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/03 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>20</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>4</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>452</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>8</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2630054</DELIVERY_ID>
    <ORDER_HEADER_ID>1435114</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004463</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-396</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4580160</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>96909</INVENTORY_ITEM_ID>
    <PART_NUMBER>778729-01</PART_NUMBER>
    <PART_DESC>NI PCI-4474, 4 INPUTS, 24-BIT DYNAMIC SIGNAL ACQUISITION</PART_DESC>
    <PART_CUSTOM_DESC>PCI-4474, Automatic Data Processing Plug-In Board</PART_CUSTOM_DESC>
    <PLANNER_CODE>INSTRHMPS</PLANNER_CODE>
    <HTS_CODE>8471.80.4000</HTS_CODE>
    <TARIC_CODE>8471.80.0000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>960</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>960</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>960</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>3840</EXTENDED_PRICE>
    <UNIT_WEIGHT>.68</UNIT_WEIGHT>
    <NET_WEIGHT>2.72</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/04 NIC</WAYBILL>
    <BREAKDOWN_COUNT>0</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE></BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE></BREAKDOWN_VALUE>
    <COMPONENT></COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE></COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO></COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    </LIST_G_LINES>
    </G_HEADER>
    </LIST_G_HEADER>
    </NI_COMMERCIAL_INVOICE_XMLP>
    I want my report for part number (which has multiple component) look like:
    Part Number: 779475-01     Quantity: 23          Part Count:2     Breakdown Count:6
    Component: CD          Amount: 115
    Component: IP          Amount: 3151
    Component: Paper          Amount: 46
    Any help or suggestion is appreciated
    RK Shah
    [email protected]

    I am using the latest 10.1.3.2.1 build 87.
    The output that I see is :
    Part Number: 777687-14 Quantity: 4 Part Count:1 Breakdown Count:3
    Component: CD
    Count: 4
    Sum of Component Price: 20
    Component: IP
    Count: 0
    Sum of Component Price: 452
    Component: Paper
    Count: 0
    Sum of Component Price: 8
    Part Number: 777687-20 Quantity: 1 Part Count:1 Breakdown Count:3
    Component: CD
    Count: 1
    Sum of Component Price: 5
    Component: Paper
    Count: 0
    Sum of Component Price: 2
    Component: IP
    Count: 0
    Sum of Component Price: 75
    Part Number: 779475-01 Quantity: 23 Part Count:2 Breakdown Count:3
    Component: CD
    Count: 23
    Sum of Component Price: 115
    Component: Paper
    Count: 0
    Sum of Component Price: 46
    Component: IP
    Count: 0
    Sum of Component Price: 3151
    and the XML data that I used is :
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.25.0 -->
    <NI_COMMERCIAL_INVOICE_XMLP>
    <LIST_G_HEADER>
    <G_HEADER>
    <COMM_INV_NUMBER>C/901000598</COMM_INV_NUMBER>
    <COMM_INV_VERSION_NUMBER>1</COMM_INV_VERSION_NUMBER>
    <SHIP_FROM_NAME>National Instruments Europe Corp.</SHIP_FROM_NAME>
    <SHIP_FROM_ADDR>H-4031, Debrecen, Hatar ut 1/A</SHIP_FROM_ADDR>
    <SHIP_FROM_CITY></SHIP_FROM_CITY>
    <SHIP_FROM_STATE></SHIP_FROM_STATE>
    <SHIP_FROM_POSTAL_CODE></SHIP_FROM_POSTAL_CODE>
    <SHIP_FROM_COUNTRY>Hungary</SHIP_FROM_COUNTRY>
    <SHIP_TO_NAME>National Instruments Corporation (NIEC)</SHIP_TO_NAME>
    <FORMATTED_SHIP_TO_ADDR>11500 N Mopac Expwy
    Austin, TX 78759-3504
    United States</FORMATTED_SHIP_TO_ADDR>
    <SHIP_TO_ADDR1>11500 N Mopac Expwy</SHIP_TO_ADDR1>
    <SHIP_TO_ADDR2></SHIP_TO_ADDR2>
    <SHIP_TO_ADDR3></SHIP_TO_ADDR3>
    <SHIP_TO_ADDR4></SHIP_TO_ADDR4>
    <SHIP_TO_CITY>Austin</SHIP_TO_CITY>
    <SHIP_TO_STATE>TX </SHIP_TO_STATE>
    <SHIP_TO_POSTAL_CODE>78759-3504</SHIP_TO_POSTAL_CODE>
    <SHIP_TO_COUNTRY>US</SHIP_TO_COUNTRY>
    <SHIP_TO_EMAIL_ADDR></SHIP_TO_EMAIL_ADDR>
    <BILL_TO_ORG_ID>807737</BILL_TO_ORG_ID>
    <SHIPPED_VIA>UPS</SHIPPED_VIA>
    <DELIVERY_TERM>DDU</DELIVERY_TERM>
    <TEXT_FILE_SEPARATOR></TEXT_FILE_SEPARATOR>
    <DELIVERY_COUNT>4</DELIVERY_COUNT>
    <HEADER_WAYBILL></HEADER_WAYBILL>
    <LIST_G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629769</DELIVERY_ID>
    <ORDER_HEADER_ID>1431282</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004434</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-387</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4565737</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>26818</INVENTORY_ITEM_ID>
    <PART_NUMBER>777459-23</PART_NUMBER>
    <PART_DESC>SCC-AI04, 2-CHANNEL ISOLATED ANALOG INPUT</PART_DESC>
    <PART_CUSTOM_DESC>SCC-AI04, Automatic Data Processing Plug-In Board</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8471.80.9000</HTS_CODE>
    <TARIC_CODE>8471.80.0000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>158</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>158</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>158</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>632</EXTENDED_PRICE>
    <UNIT_WEIGHT>.16</UNIT_WEIGHT>
    <NET_WEIGHT>.64</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/01 NIC</WAYBILL>
    <BREAKDOWN_COUNT>0</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE></BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE></BREAKDOWN_VALUE>
    <COMPONENT></COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE></COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO></COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629769</DELIVERY_ID>
    <ORDER_HEADER_ID>1431282</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004434</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-387</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579950</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>143949</INVENTORY_ITEM_ID>
    <PART_NUMBER>779475-01</PART_NUMBER>
    <PART_DESC>SCC-68 I/O CONNECTOR BLOCK WITH 4 SCC SIGNAL CONDITIONING MODULE SLOTS</PART_DESC>
    <PART_CUSTOM_DESC>SCC-68, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>DAQH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>144</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>10</ORIG_SHIP_QTY>
    <UNIT_PRICE>144</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>144</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>10</SHIP_QTY>
    <EXTENDED_PRICE>1440</EXTENDED_PRICE>
    <UNIT_WEIGHT>1.06</UNIT_WEIGHT>
    <NET_WEIGHT>10.6</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/01 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>50</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>10</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>20</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>1370</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629822</DELIVERY_ID>
    <ORDER_HEADER_ID>1425429</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004365</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-372</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579940</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>22643</INVENTORY_ITEM_ID>
    <PART_NUMBER>777687-20</PART_NUMBER>
    <PART_DESC>SCXI-1320 TEMPERATURE SENSOR TERMINAL BLOCK, CAST</PART_DESC>
    <PART_CUSTOM_DESC>SCXI-1320, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>82</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>1</ORIG_SHIP_QTY>
    <UNIT_PRICE>82</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>82</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>1</SHIP_QTY>
    <EXTENDED_PRICE>82</EXTENDED_PRICE>
    <UNIT_WEIGHT>.57</UNIT_WEIGHT>
    <NET_WEIGHT>.57</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/02 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>5</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>1</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>2</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>75</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2629822</DELIVERY_ID>
    <ORDER_HEADER_ID>1427673</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004391</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-377</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4579948</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>143949</INVENTORY_ITEM_ID>
    <PART_NUMBER>779475-01</PART_NUMBER>
    <PART_DESC>SCC-68 I/O CONNECTOR BLOCK WITH 4 SCC SIGNAL CONDITIONING MODULE SLOTS</PART_DESC>
    <PART_CUSTOM_DESC>SCC-68, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>DAQH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>144</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>13</ORIG_SHIP_QTY>
    <UNIT_PRICE>144</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>144</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>13</SHIP_QTY>
    <EXTENDED_PRICE>1872</EXTENDED_PRICE>
    <UNIT_WEIGHT>1.06</UNIT_WEIGHT>
    <NET_WEIGHT>13.78</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/02 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>65</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>13</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>26</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>1781</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2630021</DELIVERY_ID>
    <ORDER_HEADER_ID>1429687</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004410</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-383</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4578220</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>61816</INVENTORY_ITEM_ID>
    <PART_NUMBER>777687-14</PART_NUMBER>
    <PART_DESC>SCXI-1314 FRONT MOUNTING TERMINAL BLOCK</PART_DESC>
    <PART_CUSTOM_DESC>SCXI-1314, Screw Terminals</PART_CUSTOM_DESC>
    <PLANNER_CODE>SCXIH-MPS</PLANNER_CODE>
    <HTS_CODE>8536.90.4000</HTS_CODE>
    <TARIC_CODE>8536.90.1000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>120</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>120</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>120</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>480</EXTENDED_PRICE>
    <UNIT_WEIGHT>.68</UNIT_WEIGHT>
    <NET_WEIGHT>2.72</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/03 NIC</WAYBILL>
    <BREAKDOWN_COUNT>3</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>CD</COMPONENT>
    <COMPONENT_DESC>Test1</COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>20</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2803.00.0050</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE>Test1</COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY>4</COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>IP</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>452</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE>HTS CODE</BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE>8536.90.4000</BREAKDOWN_VALUE>
    <COMPONENT>Paper</COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE>8</COMPONENT_PRICE>
    <COMPONENT_HTS_CODE>2839.90.0000</COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO>HU</COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    <G_LINES>
    <DELIVERY_ID>2630054</DELIVERY_ID>
    <ORDER_HEADER_ID>1435114</ORDER_HEADER_ID>
    <ORDER_NUMBER>10004463</ORDER_NUMBER>
    <CUST_PO_NUMBER>310986-396</CUST_PO_NUMBER>
    <ORDER_LINE_ID>4580160</ORDER_LINE_ID>
    <INVENTORY_ITEM_ID>96909</INVENTORY_ITEM_ID>
    <PART_NUMBER>778729-01</PART_NUMBER>
    <PART_DESC>NI PCI-4474, 4 INPUTS, 24-BIT DYNAMIC SIGNAL ACQUISITION</PART_DESC>
    <PART_CUSTOM_DESC>PCI-4474, Automatic Data Processing Plug-In Board</PART_CUSTOM_DESC>
    <PLANNER_CODE>INSTRHMPS</PLANNER_CODE>
    <HTS_CODE>8471.80.4000</HTS_CODE>
    <TARIC_CODE>8471.80.0000</TARIC_CODE>
    <COUNTRY_OF_ORIGIN>HU</COUNTRY_OF_ORIGIN>
    <ORDER_CURRENCY_CODE>USD</ORDER_CURRENCY_CODE>
    <ORIG_UNIT_PRICE>960</ORIG_UNIT_PRICE>
    <ORIG_SHIP_QTY>4</ORIG_SHIP_QTY>
    <UNIT_PRICE>960</UNIT_PRICE>
    <PRICE_CALC_STEP_NUMBER>100</PRICE_CALC_STEP_NUMBER>
    <PRICE_CALC_CURRENCY_CODE>USD</PRICE_CALC_CURRENCY_CODE>
    <PRICE_CALC_UNIT_PRICE>960</PRICE_CALC_UNIT_PRICE>
    <PRICE_CALC_CONV_RATE>1</PRICE_CALC_CONV_RATE>
    <SHIP_QTY>4</SHIP_QTY>
    <EXTENDED_PRICE>3840</EXTENDED_PRICE>
    <UNIT_WEIGHT>.68</UNIT_WEIGHT>
    <NET_WEIGHT>2.72</NET_WEIGHT>
    <ACQ_SOURCE_CODE></ACQ_SOURCE_CODE>
    <ACQ_ORDER_NUMBER></ACQ_ORDER_NUMBER>
    <ACQ_SOURCE_ORDER_NUMBER></ACQ_SOURCE_ORDER_NUMBER>
    <ACQ_SELLING_PRICE>0</ACQ_SELLING_PRICE>
    <SUBINVENTORY>NIEC Stage</SUBINVENTORY>
    <SHIP_TO_SITE_USE_ID>807736</SHIP_TO_SITE_USE_ID>
    <FREIGHT_COST>0</FREIGHT_COST>
    <PAYMENT_TERMS>NIH InterCo</PAYMENT_TERMS>
    <WAYBILL>901000598/04 NIC</WAYBILL>
    <BREAKDOWN_COUNT>0</BREAKDOWN_COUNT>
    <LIST_G_BREAKDOWN>
    <G_BREAKDOWN>
    <BREAKDOWN_TYPE></BREAKDOWN_TYPE>
    <BREAKDOWN_VALUE></BREAKDOWN_VALUE>
    <COMPONENT></COMPONENT>
    <COMPONENT_DESC></COMPONENT_DESC>
    <COMPONENT_CUSTOM_DESC></COMPONENT_CUSTOM_DESC>
    <COMPONENT_PRICE></COMPONENT_PRICE>
    <COMPONENT_HTS_CODE></COMPONENT_HTS_CODE>
    <COMPONENT_TARIC_CODE></COMPONENT_TARIC_CODE>
    <COMPONENT_COO></COMPONENT_COO>
    <COMPONENT_QTY></COMPONENT_QTY>
    </G_BREAKDOWN>
    </LIST_G_BREAKDOWN>
    </G_LINES>
    </LIST_G_LINES>
    </G_HEADER>
    </LIST_G_HEADER>
    </NI_COMMERCIAL_INVOICE_XMLP>

  • Error while running Process Order API to import orders - URGENT HELP NEEDED

    Hi all,
    I'm stuck with order import using OE_ORDER_PUB.PROCESS_ORDER api. Wanted to import a simple order in Vision database using the process order api. Figured out the right data to use, inserted into Headers and Lines Iface All tables. When calling the OE_ORDER_PUB.PROCESS_ORDER api, it is throwing this error:
    "Header ID does not exist on this record or does not match ID specified on header record. You require a valid header ID if the operation is Create."
    But when I validate the same record using the CORRECTIONS form in Order Import GUI, the order is successfully validated. Also the order is imported when I click the IMPORT button.
    I understand that HEADER_ID column is not required for creating a new order, but not sure why it is erroring. Here is the data I'm using:
    Insert into oe_headers_iface_all
    (org_id, order_type_id, order_source_id, orig_sys_document_ref, ordered_date, request_date,
    sold_from_org_id, sold_to_org_id, ship_from_org_id, ship_to_org_id, invoice_to_org_id,
    CREATED_BY,CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN,OPERATION_CODE)
    values (204, 1430, 1046, '101040', sysdate, sysdate, 204, 1004, 606, 1018, 1017, 0, sysdate, 0, sysdate, 0, 'CREATE');
    Insert into oe_lines_iface_all
    ("ORDER_SOURCE_ID","ORIG_SYS_DOCUMENT_REF","ORIG_SYS_LINE_REF","ORIG_SYS_SHIPMENT_REF","ORG_ID","INVENTORY_ITEM","LINE_TYPE_ID",request_date,"SCHEDULE_DATE","DELIVERY_LEAD_TIME","ORDERED_QUANTITY","ORDER_QUANTITY_UOM",sold_from_org_id, sold_to_org_id, ship_from_org_id, ship_to_org_id, invoice_to_org_id,"UNIT_SELLING_PRICE","CREATED_BY","CREATION_DATE","LAST_UPDATED_BY","LAST_UPDATE_DATE","LAST_UPDATE_LOGIN","OPERATION_CODE")
    values
    (1046,'101040', '1', '1', 204, 'AS72111', 1427, sysdate, sysdate+1, 0, 10, 'Ea' ,204, 1004, 606, 1018, 1017,100,0,sysdate,0,sysdate,0,'CREATE');
    Any help is appreciated.
    FYI - this is a 11.5.10.2 version installed on Windows 2003 server.
    Thanks in advance.
    Jags

    I might be late in replying, but hope it might help.
    From your query it seems you are inserting records into interface tables and then calling process order API( probably from some PL/SQL block).
    This is where I am confused, because I hope you understand, that interface tables are for use with Order Import concurrent Program, and for Process ORder API, you need to provide the data as parameter. The api has, header record type and line table type as parameters. So you need to assign correct data to these variables and pass them as parameter when you are calling Process Order API.
    If you are doing the same thing, then post the exact pl/SQL code and error message from the API. That might help diagnose the issue.
    Regards,
    Nitin Darji

  • Date_format, group by and order by together

    Hi,
    SELECT
                             T.foreign_network_id as "Network ID",
                             date_format(T.ARRIVAL_DATE,'%v-%x') as "Date",
                        sum(case when((networks_rejected = 0)
                                       and (T.sor_reapply = 'N')
                                       and (T.sor_reason in ('NP', 'NU', 'NT', 'HT')))
                                       then T.CNT else 0 end) as "Before Steering",
                   sum(case when(sor_reason in ('NP', 'HT', 'T2', 'TM', 'NM', 'MM', 'IPMM', 'NPMM'))
                                  then T.CNT else 0 end) as "After Steering"
              FROM     ST_INC T,
                        NETWORKS N,
                        ZONE_NW_MAP ZN,
                        ZONES Z,
                        PAYMENT_TYPE PT
              WHERE      T.FOREIGN_NETWORK_ID = N.NETWORK_ID
              AND      ZN.NETWORK_ID = N.NETWORK_ID
              AND      Z.ZONE_ID = ZN.ZONE_ID
              AND      PT.id = T.ptype
              AND opcode = 2
              AND      sor_action is not null
                             and Z.ZONE_ID = 269
                   group by
                             date_format(T.ARRIVAL_DATE,'%v-%x'),
    T.foreign_network_id
    order by date_format(T.ARRIVAL_DATE,'%v-%x')
    Above code works but it orders malfunctionally. It orders as if the week-day combination is a string not a date.
    I want:
    09.2009
    10.2009
    02.2010
    03.2010
    06.2011
    It outputs:
    02.2010
    03.2010
    06.2011
    09.2009
    10.2009
    I know that the problem arises from the "order by" part. When I call the function date_format I guess a different data type is returnd thus the result is not achieved as intended. So I thought of changing that part only making last line order by T.ARRIVAL_DATE. It worked fine in mysql however it gave error in oracle. This is the error:
    ORA-00979: not a GROUP BY expression
    00979. 00000 - "not a GROUP BY expression"
    When I replace all "date_format(T.ARRIVAL_DATE,'%v-%x')" s with "T.ARRIVAL_DATE" it works fine again. However this is not what i wanted. I want to see the results in the format I gave and group with respect to that fomat, additionally ordering them chronologically. How is that possible?

    Frank Kulash wrote:
    Hi,
    baydinfb wrote:
    Hi,
    SELECT
                             T.foreign_network_id as "Network ID",
                             date_format(T.ARRIVAL_DATE,'%v-%x') as "Date",
                        sum(case when((networks_rejected = 0)
                                       and (T.sor_reapply = 'N')
                                       and (T.sor_reason in ('NP', 'NU', 'NT', 'HT')))
                                       then T.CNT else 0 end) as "Before Steering",
                   sum(case when(sor_reason in ('NP', 'HT', 'T2', 'TM', 'NM', 'MM', 'IPMM', 'NPMM'))
                                  then T.CNT else 0 end) as "After Steering"
              FROM     ST_INC T,
                        NETWORKS N,
                        ZONE_NW_MAP ZN,
                        ZONES Z,
                        PAYMENT_TYPE PT
              WHERE      T.FOREIGN_NETWORK_ID = N.NETWORK_ID
              AND      ZN.NETWORK_ID = N.NETWORK_ID
              AND      Z.ZONE_ID = ZN.ZONE_ID
              AND      PT.id = T.ptype
              AND opcode = 2
              AND      sor_action is not null
                             and Z.ZONE_ID = 269
                   group by
                             date_format(T.ARRIVAL_DATE,'%v-%x'),
    T.foreign_network_id
    order by date_format(T.ARRIVAL_DATE,'%v-%x')
    Above code works but it orders malfunctionally. It orders as if the week-day combination is a string not a date. Apparantly, date_format returns a string, similar to how TO_CHAR in Oracle returns a string. To verify this, create a view where one on the columns is the results of date_format, and then describe that view.
    I want:
    09.2009
    10.2009
    02.2010
    03.2010
    06.2011
    It outputs:
    02.2010
    03.2010
    06.2011
    09.2009
    10.2009
    I know that the problem arises from the "order by" part. When I call the function date_format I guess a different data type is returnd thus the result is not achieved as intended. So I thought of changing that part only making last line order by T.ARRIVAL_DATE. It worked fine in mysql however it gave error in oracle. This is the error:
    ORA-00979: not a GROUP BY expression
    00979. 00000 - "not a GROUP BY expression"
    When I replace all "date_format(T.ARRIVAL_DATE,'%v-%x')" s with "T.ARRIVAL_DATE" it works fine again. However this is not what i wanted. I want to see the results in the format I gave and group with respect to that fomat, additionally ordering them chronologically. How is that possible?I don't know about yur database, but in Oracle you can "GROUP BY t.arrival_date", and still use expressions like "TO_CHAR (t.arrival_date, ...)" in the SELECT clause. Then, if you say "ORDER BY t.arrival_date" it will sort by the arrival_date column in the table, even if the alias "arrival_date" is used for something else.
    Using scott.emp to illustrate:
    SELECT       TO_CHAR (e.hiredate, 'fmMonth YYYY')     AS hiredate
    ,       e.hiredate                    AS raw_date
    FROM       scott.emp     e
    GROUP BY  e.hiredate
    ORDER BY  hiredate          -- This means the result set column called "HIREDATE"
    ,       e.hiredate          -- This means the table column called "HIREDATE"
    ;Output:
    HIREDATE                                  RAW_DATE
    April 1981                                02-Apr-1981 00:00:00
    April 1987                                19-Apr-1987 00:00:00
    December 1980                             17-Dec-1980 00:00:00
    December 1981                             03-Dec-1981 00:00:00
    February 1981                             20-Feb-1981 00:00:00
    February 1981                             22-Feb-1981 00:00:00
    January 1982                              23-Jan-1982 00:00:00
    June 1981                                 09-Jun-1981 00:00:00
    May 1981                                  01-May-1981 00:00:00
    May 1987                                  23-May-1987 00:00:00
    November 1981                             17-Nov-1981 00:00:00
    September 1981                            08-Sep-1981 00:00:00
    September 1981                            28-Sep-1981 00:00:00Notice how, within a month (e.g. February 1981) the rows are sorted by DATE.Thanks for the answers, I tried, no errors but there is a problem with the requirements. Correct me if I am wrong.
    I can use the expression with "date_format" or "to_char" in select clause and then group by the actual date field. But this does not include all I want. When I formatted a date column as "week-year" such as 09.2010 I also meant to group by according to that format. In your solution totally same dates are grouped together but I want to be able to have that same weeks(no need to have same days) are grouped or even same months are grouped by and then order by actual date.
    Edited by: baydinfb on Aug 27, 2010 2:13 PM

  • 3 Table Join with group by and order by clauses

    I am porting from MySQL to Oracle 8i. I have a three Table Join in MySQL as follows:
    select distinct TO_DAYS(l.listend)-TO_DAYS(NOW()) AS daysLeft, i.minbid, l.listend, i.itemid, i.itemtitle, l.listingid, l.lendstart, l.lendend, l.status, MAX(b.amount) AS curBid, COUNT(b.amount) AS numBids from TBL_ITEMS i, TBL_LISTING l LEFT JOIN TBL_BIDS b ON l.listingid=b.listingid where i.itemid = l.itemid AND l.status='1' AND (TO_DAYS(l.listend)-TO_DAYS(NOW()) >= 0) AND i.catcode LIKE'12__' GROUP BY listingid order by curBid DESC, daysLeft;
    It performs an straight join on the first 2 tables (TBL_ITEMS and TBL_LISTING) and a LEFT JOIN between the previous result set and TBL_BIDS. TBL_BIDS uses a group by clause to obtain MAX and COUNT info. This final result set is the sorted (ORDER BY).
    I have tried to reconstruct this type of call in Oracle and have failed. Several problems that I have notices: Oracle does not let me pull in additional columns when doing a GROUP BY clause.
    (see below for my work around)
    I have worked around the problem by creating a TABLE with the group by functionality and doing a straing 3 table join. (NOTE: I cannot create a view because use a LIKE function in the call... view dont have indexes). However, when I try to alias the column that returns DATE subtraction ("l.listend-TRUNC(SYSDATE) daysLeft" OR "l.listend-TRUNC(SYSDATE) dayLeft") I cannot use the LIKE statement.
    Here is my question. How do I port the above 3-table MySQL call to Oracle. Why am I having these problems (is it the Oracle optimizer?) and how do I avaopid them in the future.
    I really appreciate anyone's input. Thanks,
    Inder
    WORK AROUND:
    FIRST STEP:
    "create TABLE BIDSUM as
    select l.listingid, COUNT(b.amount) numBids, MAX(b.amount) curBid from TBL_LISTING l, TBL_BIDS b where l.listingid=b.listingid(+) group by (l.listingid);"
    NEXT STEP:
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE), l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12%';
    THIS ALSO WORKS (no LIKE):
    "select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode='12'";
    BUT THIS DOES NOT (alias the DATE arimetic)
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12__';

    I am porting from MySQL to Oracle 8i. I have a three Table Join in MySQL as follows:
    select distinct TO_DAYS(l.listend)-TO_DAYS(NOW()) AS daysLeft, i.minbid, l.listend, i.itemid, i.itemtitle, l.listingid, l.lendstart, l.lendend, l.status, MAX(b.amount) AS curBid, COUNT(b.amount) AS numBids from TBL_ITEMS i, TBL_LISTING l LEFT JOIN TBL_BIDS b ON l.listingid=b.listingid where i.itemid = l.itemid AND l.status='1' AND (TO_DAYS(l.listend)-TO_DAYS(NOW()) >= 0) AND i.catcode LIKE'12__' GROUP BY listingid order by curBid DESC, daysLeft;
    It performs an straight join on the first 2 tables (TBL_ITEMS and TBL_LISTING) and a LEFT JOIN between the previous result set and TBL_BIDS. TBL_BIDS uses a group by clause to obtain MAX and COUNT info. This final result set is the sorted (ORDER BY).
    I have tried to reconstruct this type of call in Oracle and have failed. Several problems that I have notices: Oracle does not let me pull in additional columns when doing a GROUP BY clause.
    (see below for my work around)
    I have worked around the problem by creating a TABLE with the group by functionality and doing a straing 3 table join. (NOTE: I cannot create a view because use a LIKE function in the call... view dont have indexes). However, when I try to alias the column that returns DATE subtraction ("l.listend-TRUNC(SYSDATE) daysLeft" OR "l.listend-TRUNC(SYSDATE) dayLeft") I cannot use the LIKE statement.
    Here is my question. How do I port the above 3-table MySQL call to Oracle. Why am I having these problems (is it the Oracle optimizer?) and how do I avaopid them in the future.
    I really appreciate anyone's input. Thanks,
    Inder
    WORK AROUND:
    FIRST STEP:
    "create TABLE BIDSUM as
    select l.listingid, COUNT(b.amount) numBids, MAX(b.amount) curBid from TBL_LISTING l, TBL_BIDS b where l.listingid=b.listingid(+) group by (l.listingid);"
    NEXT STEP:
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE), l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12%';
    THIS ALSO WORKS (no LIKE):
    "select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode='12'";
    BUT THIS DOES NOT (alias the DATE arimetic)
    select i.minbid, i.itemtitle, l.lendstart-TRUNC(SYSDATE) daysLeft, l.lendend, l.listingid, l.status, s.numbids, s.curbid from TBL_ITEMS i, TBL_LISTING l, BIDSUM s where l.listingid=s.listingid AND i.itemid=l.itemid AND l.status='1' AND i.catcode LIKE '12__';

  • SQL Query Sorting Order issue - Help needed

    Hi All,
    I am using the following query in my project to display the records in the grid.
    /* Formatted on 04-09-2013 PM 8:01:51 (QP5 v5.149.1003.31008) */
      SELECT eol,
             status_msg,
             relation,
             building_name,
             device_id id,
             CEIL (SYSDATE - updated_date) duration,
             lab_id,
             aisle_id,
             aisle_location_id,
             ip_address,
             port,
             slot_num,
             hostname,
             pid,
             description,
             sl_num,
             eitms_code,
             status,
             dnd_flag,
             aisle,
             aisle_location,
             spname,
             os_version,
             user_id,
             TO_CHAR (updated_date, 'YYYY-MM-DD HH24:MI:SS') updated_date,
             isterm_svr,
             net_type,
             DEVICE_GROUP_REF,
             cmd_id_ref,
             LISTAGG (TESTBED_ID, ',') WITHIN GROUP (ORDER BY TESTBED_ID)
                AS testbeds_id_ref,
             LISTAGG (NAME, ',') WITHIN GROUP (ORDER BY TESTBED_ID)
                AS testbeds_names,
             spname || '-' || ip_address || '-' || port AS child_asset_group
        FROM DEVICE_TESTBED_VW
       WHERE lab_id IN
                ('7099849',
                 '10769617',
                 '4258712',
                 '10513562',
                 '10515074',
                 '5882676',
                 '8330925')
    GROUP BY eol,
             status_msg,
             relation,
             device_id,
             lab_id,
             aisle_id,
             aisle_location_id,
             ip_address,
             port,
             slot_num,
             hostname,
             pid,
             description,
             sl_num,
             eitms_code,
             status,
             dnd_flag,
             aisle,
             aisle_location,
             spname,
             os_version,
             user_id,
             updated_date,
             isterm_svr,
             net_type,
             DEVICE_GROUP_REF,
             cmd_id_ref,
             building_name
    ORDER BY building_name ASC,
             LOWER (child_asset_group) ASC,
             LOWER (relation) DESC
    The problem is , if any one sorting with any column  , the order is not correct
    In this below code , i have done sorting by port . But the result data order is not correct .
    /* Formatted on 04-09-2013 PM 8:07:02 (QP5 v5.149.1003.31008) */
      SELECT eol,
             status_msg,
             relation,
             building_name,
             device_id id,
             CEIL (SYSDATE - updated_date) duration,
             lab_id,
             aisle_id,
             aisle_location_id,
             ip_address,
             port,
             slot_num,
             hostname,
             pid,
             description,
             sl_num,
             eitms_code,
             status,
             dnd_flag,
             aisle,
             aisle_location,
             spname,
             os_version,
             user_id,
             TO_CHAR (updated_date, 'YYYY-MM-DD HH24:MI:SS') updated_date,
             isterm_svr,
             net_type,
             DEVICE_GROUP_REF,
             cmd_id_ref,
             LISTAGG (TESTBED_ID, ',') WITHIN GROUP (ORDER BY TESTBED_ID)
                AS testbeds_id_ref,
             LISTAGG (NAME, ',') WITHIN GROUP (ORDER BY TESTBED_ID)
                AS testbeds_names,
             spname || '-' || ip_address || '-' || port AS child_asset_group
        FROM DEVICE_TESTBED_VW
       WHERE lab_id IN
                ('7099849',
                 '10769617',
                 '4258712',
                 '10513562',
                 '10515074',
                 '5882676',
                 '8330925')
    GROUP BY eol,
             status_msg,
             relation,
             device_id,
             lab_id,
             aisle_id,
             aisle_location_id,
             ip_address,
             port,
             slot_num,
             hostname,
             pid,
             description,
             sl_num,
             eitms_code,
             status,
             dnd_flag,
             aisle,
             aisle_location,
             spname,
             os_version,
             user_id,
             updated_date,
             isterm_svr,
             net_type,
             DEVICE_GROUP_REF,
             cmd_id_ref,
             building_name
    ORDER BY PORT ASC
    Can some one help me to fix this issue?

    Hi,
    Sorry, it's not clear what you want.
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Simplify the problem as much as possible. For example, if you really need to GROUP BY 28 columns, post a problem where you need to GROUP BY only 2 or 3 columns.  (Just explain that you really have 28, so people will give solutions that are sure to work for all 28).)
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Group by and Order by...

    Hi Guys,
    I need to get a value in a specific order in a select statment.
    I have the following table...
    with t as(
    SELECT 1 ID, 'aaa' VAL FROM dual UNION ALL
    SELECT 2 ID, 'aaa' VAL FROM dual UNION ALL
    SELECT 3 ID, 'bbb' VAL FROM dual UNION ALL
    SELECT 4 ID, 'bbb' VAL FROM dual UNION ALL
    SELECT 5 ID, 'ccc' VAL FROM dual )
    SELECT DISTINCT val
    FROM   t
    ORDER BY t.id;This genarates an error 'Not a SELECTed operation'.
    The out put I am expecting is...
    aaa
    bbb
    ccc
    (Distinct Val values with Order by ID)
    Is this possible?
    Thanks...

    The problem is that the distinct implicitly groups the data. And when it has grouped the data, there is no ID column available anymore.
    SQL> with t as(
      2  SELECT 1 ID, 'aaa' VAL FROM dual UNION ALL
      3  SELECT 2 ID, 'aaa' VAL FROM dual UNION ALL
      4  SELECT 3 ID, 'bbb' VAL FROM dual UNION ALL
      5  SELECT 4 ID, 'bbb' VAL FROM dual UNION ALL
      6  SELECT 5 ID, 'ccc' VAL FROM dual )
      7  SELECT DISTINCT val
      8  FROM   t
      9  ORDER BY t.id
    10  /
    ORDER BY t.id
    ERROR at line 9:
    ORA-01791: not a SELECTed expressionYou write that you want your output to be:
    aaa
    bbb
    ccc
    but how do you want your output to be when this is your source data?
    SQL> with t as(
      2  SELECT 1 ID, 'aaa' VAL FROM dual UNION ALL
      3  SELECT 2 ID, 'bbb' VAL FROM dual UNION ALL
      4  SELECT 3 ID, 'bbb' VAL FROM dual UNION ALL
      5  SELECT 4 ID, 'aaa' VAL FROM dual UNION ALL
      6  SELECT 5 ID, 'ccc' VAL FROM dual )
      7  SELECT DISTINCT val
      8  FROM   t
      9  ORDER BY t.id
    10  /
    ORDER BY t.id
    ERROR at line 9:
    ORA-01791: not a SELECTed expressionThere is now also a 'aaa' value at ID 4, after 'bbb' at ID's 2 and 3. You didn't tell and that's why Oracle can't execute your query.
    If you convert your query to use a group by operation, then you can explicitly tell on which aggregated expression you want your results to be ordered:
    SQL> with t as(
      2  SELECT 1 ID, 'aaa' VAL FROM dual UNION ALL
      3  SELECT 2 ID, 'aaa' VAL FROM dual UNION ALL
      4  SELECT 3 ID, 'bbb' VAL FROM dual UNION ALL
      5  SELECT 4 ID, 'bbb' VAL FROM dual UNION ALL
      6  SELECT 5 ID, 'ccc' VAL FROM dual )
      7  select val
      8    from t
      9   group by val
    10   order by min(id)
    11  /
    VAL
    aaa
    bbb
    ccc
    3 rows selected.Hope this helps.
    Regards,
    Rob.

  • Purchase order report -help needed.

    Hi guys,
    Can anyone help me create a report for the purchase orders (similar to ME2N) ,my company needs all the info related to a PO like payment history.we need to pull all <b>closed POs</b> during a certain time period.Is ther a way todo this .
    I'd appreciate your help.'
    Thanks
    Cheris T

    Hello,
    You will need to run both ME80N and FBL1N. ME80FN can display PO history and from FBL1N you can get payment history.
    Hope this helps !
    Cheers !

  • Grouping Rules in PL/SQL Help needed

    Hi I have a requirement where I wan to group based on the below scenario
    I have a Table_A
    Table_A strcuture:
    create table table_a
    code number,
    name varchar2 (100),
    city varchar2 (100),
    dept varchar2 (100));;
    insert into table_a
    values
    1,'ABC','EA','A');
    insert into table_a
    values
    1,'ABC','EA1','A');
    insert into table_a
    values
    2,'BCD','EA2','A');
    insert into table_a
    values
    2,'ABC','EA3','A'');
    insert into table_a
    values
    3,'KBC','EA,'A');
    insert into table_a
    values
    3,'ABC','EA,'A');
    wan to group the above table data based on name,city,dept
    I wan the data  as
    1           ABC             EA1    A
                 BCD            EA2     A
    2           BCD            EA2     A
                 ABC            EA3     A
    3           KBC            EA      A
                 BCD            EA      A
    Kindly any help will be needful for me

    This is more of a presentation layer problem I would not handle it in SQL. For example if the presentation layer is SQL Plus you can use BREAK command, like this.
    SQL> select * from table_a;
          CODE NAME       CITY       DEPT
             1 ABC        EA         A
             1 ABC        EA1        A
             2 BCD        EA2        A
             2 ABC        EA3        A
             3 KBC        EA         A
             3 ABC        EA         A
    6 rows selected.
    SQL> break on code
    SQL>
    SQL> select * from table_a order by code;
          CODE NAME       CITY       DEPT
             1 ABC        EA         A
               ABC        EA1        A
             2 BCD        EA2        A
               ABC        EA3        A
             3 KBC        EA         A
               ABC        EA         A
    6 rows selected.
    But if you still wish to do it in SQL the right way is to use ROW_NUMBER like this.
    SQL> clear breaks
    breaks cleared
    SQL>
    SQL> select * from table_a;
          CODE NAME       CITY       DEPT
             1 ABC        EA         A
             1 ABC        EA1        A
             2 BCD        EA2        A
             2 ABC        EA3        A
             3 KBC        EA         A
             3 ABC        EA         A
    6 rows selected.
    SQL> select decode(rno, 1, code) code
      2       , name
      3       , city
      4       , dept
      5    from (
      6           select row_number() over(partition by code order by name) rno
      7                , t.*
      8             from table_a t
      9         )
    10  /
          CODE NAME       CITY       DEPT
             1 ABC        EA         A
               ABC        EA1        A
             2 ABC        EA3        A
               BCD        EA2        A
             3 ABC        EA         A
               KBC        EA         A
    6 rows selected.

  • Posting a Question and iPod mini help needed

    It's so frustrating to use this support site. I can't seem to find the right information.
    I need help. My iPod mini just suddenly conked out on me. Now it flashes the apple then an icon with a battery and an exclamation point inside a triangle. I tried to search for an answer in this site but all I got was a suggestion to reset it. I tried re-setting it and IT DIDN'T WORK!
    What do I do now? I really want to get this fixed as soon as possible. I happen to love my iPod. Please, please, someone help!

    Welcome to Apple Discussions, serangel.
    Here is the support site for using iPod mini.
    There are plenty of users there who will be happy to help.
    Cheers!

  • Validation and Substitutions - Urgent Help needed

    Hello everyone,
    I need your help about this. This is the first time i am going to create a validation for document no. line items.
    The scenario is this:
    1. I need to check if the FI document that is to be posted contains line items where BSEG-LOKKT falls within the range of “0099990000-0099999999”. For each matching line item, I need to check if the credit line items balances with the debit line items. If TRUE then the validation will EXIT succesfully.
    2. If an FI document contains line items where BSEG-LOKKT falls within the range of “0099990000-0099999999”, but the sum of the debit line items and the credit line items is not equal to zero, validation will prevent thre user from posting the document. Error message will be raised.
    3. If FI document document does not contain line items with BSEG-LOKKT ranging from “0099990000-0099999999”, validation will exit successfully because there are no appropriate alternative accts to be verified.
    This validation will only apply to one company code.
    Please provide me with the step-by-step creation of the validation.
    Points will be rewarded for helpful answers.
    Thanks in advance.
    Bay

    look tcode ob28, validation exit and <a href="http://help.sap.com/saphelp_47x200/helpdata/en/5b/d231e143c611d182b30000e829fbfe/frameset.htm">here</a>
    A.

Maybe you are looking for

  • Queries on oracle hang after index creation

    Hi, I have a problem where queries issued on an oracle database hang after I create indexes on some of the tables used by these queries. I have a script where I drop indexes : DROP INDEX EVP_PCON00_CDSITC_IX; DROP INDEX EVP_PCS202_STIMP1_IX; DROP IND

  • Qosmio F50-10M: how to deactivate touchpad?

    Hello guys, usually I use a USB driven mouse to operate Win7. While writing text I often get in contact with the touch pad unwanted. As I cannot identify the appropriate device within the hardware manager I am not able to deactive the touchpad while

  • Lexmark X4650 not working

    Hi, I am not sure about how to post here but I cannot get my Lexmark printer working. I have Mac Mini with 10.6.2. I have tried installing all the drivers from the Lexmark site and they install fine, but when I run the Lexmark Assistant, the print is

  • No delivery if order has error in CRM

    Hi All, I want to restrict delivery if system has any error in CRM Order. Requirement, (1) Created orders are successfully replicated in ECC (2) After making some changes in existing order changes are not replicated. (3) I want to restrict delivery i

  • How to stop the floating AirPlay icon

    I want to get rid of the Airplay icon that floats over my photos while I play music? I am using my photos as the screen saver and has this icon all the time. What setting do I need to change?