Mysql query not getting all the results, works fine in php

Hi All,
I have a slightly big query which works fine in php getting 400 results but in java I get only 14 results when I traverse through resultset. Here is the query
(select t1.to_uri as inv_to_uri, t1.sip_to as inv_sip_to, t1.sip_callid as inv_callid, t1.time as inv_time, t1.fromtag as inv_fromtag, t1.sip_status as inv_status, t2.to_uri as bye_to_uri, t2.sip_to as bye_sip_to, t2.sip_callid as bye_callid, t2.time as bye_time, t2.fromtag as bye_fromtag, t2.totag as bye_totag, t2.from_uri as bye_from_uri, t2.sip_from as bye_sip_from, sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length, ifnull(t1.time, t2.time) as ttime , 'outgoing' as call_type from acc t1 left outer join acc t2 on t1.sip_callid=t2.sip_callid and ((t1.totag=t2.totag and t1.fromtag=t2.fromtag) or (t1.totag=t2.fromtag and t1.fromtag=t2.totag)) and t2.sip_method='BYE' where t1.sip_method='INVITE' and (t1.username='manoj' and t1.domain='mantragroup.com') and t1.caller_deleted != '1' ) union (select t1.to_uri as inv_to_uri, t1.sip_to as inv_sip_to, t1.sip_callid as inv_callid, t1.time as inv_time, t1.fromtag as inv_fromtag, t1.sip_status as inv_status, t2.to_uri as bye_to_uri, t2.sip_to as bye_sip_to, t2.sip_callid as bye_callid, t2.time as bye_time, t2.fromtag as bye_fromtag, t2.totag as bye_totag, t2.from_uri as bye_from_uri, t2.sip_from as bye_sip_from, sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length, ifnull(t1.time, t2.time) as ttime , 'outgoing' as call_type from acc t1 right outer join acc t2 on t1.sip_callid=t2.sip_callid and ((t1.totag=t2.totag and t1.fromtag=t2.fromtag) or (t1.totag=t2.fromtag and t1.fromtag=t2.totag)) and t1.sip_method='INVITE' where t2.sip_method='BYE' and isnull(t1.username) and (t2.username='manoj' and t2.domain='mantragroup.com') and t2.callee_deleted != '1' ) order by ttime DESC limit 100,50
Also this queru works fine on mysql console getting all 400 results. Please tell me what might be going wrong in Java.
Thanks for your help and time,
Manoj.

How do you know you're doing the same query in PHP, MySQL, and the console?
What's the code that's executing this?
There's nothing intrinsically wrong with the query, although it's a bit messy - surely it could be simplified from that?
Please format queries before posting in future. Also, did you really mean to let us know your company name and the name of a user? Seems a bit indiscrete.
     select
        t1.to_uri as inv_to_uri,
        t1.sip_to as inv_sip_to,
        t1.sip_callid as inv_callid,
        t1.time as inv_time,
        t1.fromtag as inv_fromtag,
        t1.sip_status as inv_status,
        t2.to_uri as bye_to_uri,
        t2.sip_to as bye_sip_to,
        t2.sip_callid as bye_callid,
        t2.time as bye_time,
        t2.fromtag as bye_fromtag,
        t2.totag as bye_totag,
        t2.from_uri as bye_from_uri,
        t2.sip_from as bye_sip_from,
        sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length,
        ifnull(t1.time, t2.time) as ttime ,
        'outgoing' as call_type
     from
        acc t1
     left outer join
        acc t2
     on
        t1.sip_callid=t2.sip_callid
     and
        (  (t1.totag=t2.totag and t1.fromtag=t2.fromtag)
        or (t1.totag=t2.fromtag and t1.fromtag=t2.totag))
     and
        t2.sip_method='BYE'
     where
        t1.sip_method='INVITE'
     and
        (t1.username='manoj' and t1.domain='mantragroup.com') and t1.caller_deleted != '1'
union
     select
        t1.to_uri as inv_to_uri,
        t1.sip_to as inv_sip_to,
        t1.sip_callid as inv_callid,
        t1.time as inv_time,
        t1.fromtag as inv_fromtag,
        t1.sip_status as inv_status,
        t2.to_uri as bye_to_uri,
        t2.sip_to as bye_sip_to,
        t2.sip_callid as bye_callid,
        t2.time as bye_time,
        t2.fromtag as bye_fromtag,
        t2.totag as bye_totag,
        t2.from_uri as bye_from_uri,
        t2.sip_from as bye_sip_from,
        sec_to_time(unix_timestamp(t2.time)-unix_timestamp(t1.time)) as length,
        ifnull(t1.time, t2.time) as ttime ,
        'outgoing' as call_type
     from
        acc t1
     right outer join
        acc t2
     on
        t1.sip_callid=t2.sip_callid
     and
        (  (t1.totag=t2.totag and t1.fromtag=t2.fromtag)
        or (t1.totag=t2.fromtag and t1.fromtag=t2.totag))
     and
        t1.sip_method='INVITE'
     where
        t2.sip_method='BYE'
     and
        isnull(t1.username)
     and
        (t2.username='manoj' and t2.domain='mantragroup.com')
     and
        t2.callee_deleted != '1'
order by ttime DESC limit 100,50

Similar Messages

  • Not able to get all the results if i use "get-spdeletedsite" command

    Hi everyone,
    I am not able to get all the results when I use the below powershell command.
    get-spdeletedsite -limit all
    It is giving me only one site, but infact we have more than 100 deleted sites.
    If I use the normal command like below it is giving the below output
    get-spdeletedsite
    Can any one tell me, how can I get all the deleted sites ?
    Best Regards
    Anil Alladi

    Hi  Anil,
    For the Limit parameter of Get-SPDeletedSite cmdlet, when we specify its value to ALL, it  will return all site collections for the given scope.
    For your scenario, the script “Get-SPDeletedSite –Limit ALL” will return all deleted site collections in your SharePoint environment.
    If you want to get all deleted site, you can export the result to csv as below:
    Get-SPDeletedSite | export-csv out.csv -notypeinformation
    Reference:
    http://technet.microsoft.com/en-us/library/hh286316(v=office.15).aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Hi I  newly started using Iphone 6, I am not getting all the applications list under Use Cellular date for to restrict my unwanted apps on cellular data

    Hi I  newly started using Iphone 6, I am not getting all the applications list under Use Cellular date for to restrict my unwanted apps on cellular data
    Please help me out

    Hi Rajesh778484,
    Welcome to the Apple Support Communities!
    I understand that some of your applications are not appearing under Settings > Cellular on your iPhone so that you can restrict or allow use of cellular data. If you have some installed applications on your iPhone that are not showing here, the first troubleshooting step I would suggest would be to reset your iPhone. Please refer to the attached article for information on how to perform a reset. 
    Restart or reset your iPhone, iPad, or iPod touch - Apple Support
    Best regards,
    Joe

  • I am trying to import standard midi file that I created in Band in a Box into Logic Pro 9.  I can not get all the track to play with internal instrument sounds... only the piano track.  how can I get the others to play... drums, bass etc????   Help

    I am trying to import standard midi file that I created in Band in a Box into Logic Pro 9.  I can not get all the track to play with internal instrument sounds... only the piano track.  how can I get the others to play... drums, bass etc????   Help

    Don't drag the midi into an open Logic project. The tracks won't set up correctly.
    'Open' the midi file with Logic as if it were a Logic project. Then all the tracks will be set up so you can start editing them and applying better saved sounds and instruments, but you'll be at a starting place where you can hear what's going on.

  • Rendered images are not appearing on the webpage. works fine on IE. All plugins appear to be present includeing Adobe Flash

    rendered images are not appearing on the webpage. works fine on IE. All plugins appear to be present including Adobe Flash

    If that only happens on a specific page or domain then make sure that you do not block images on that domain.
    See [[Images or animations do not show]]
    *A way to see which images are blocked is to click the favicon (<i>Site Identification</i> icon) on the left side of the location bar.
    *A click on the "More Information" button will open the Security tab of the "Page Info" window (also accessible via "Tools > Page Info").
    *Go to the <i>Media</i> tab of that "Tools > Page Info" window.
    *Select the first image link and scroll down though the list with the Down arrow key.
    *If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.
    *You can see the permissions for the domain in the current tab in Tools > Page Info > Permissions
    *You can see all image exceptions in Tools > Options > Content: Load Images > Exceptions

  • Just downloaded book but did not get all the way down now cant play it  any answers

    just downloaded book but did not get all the way down now cant play it  any answers

    in iTunes, access your purchase history via your account in the iTunes store, find the file in question, and click on the report a problem button. report the problem. more info in this support article. 
    clicking here  should take you directly to your iTunes store log-in window.

  • Just updated from elements 11 to 13. When I try to use Levels in Elements 13. I click on the slider with my bamboo pen and nothing happens for a few seconds, sometimes not at all. This worked fine in Elements 11.

    Just updated from elements 11 to 13. When I try to use Levels in Elements 13. I click on the slider with my bamboo pen and nothing happens for a few seconds, sometimes not at all. This worked fine in Elements 11.

    Never mind my question on the photoshop elements 13 trying to install the camera raw update. It has been taken care of thank goodness!

  • Query to get all the worksheets for a particular work book

    Hi All,
    I want to get all the associated worksheets for a particular workbook. What query will fetch mne those details. Also, where can find the EUL5 tables documentation
    Regards
    Thomas

    Hi Tamir,
    Thanks so far. I am yet to make the crucial breakthrough as far my application goes. Are you talking about the EUL5_QPP_STATS table? I tried retrieving worksheets even from that table also with the following query
    SELECT DISTINCT Eul5QppStats.QS_DOC_NAME,Eul5QppStats.QS_DOC_DETAILS
    FROM EUL5_QPP_STATS Eul5QppStats,EUL5_DOCUMENTS Eul5Documents
    WHERE Eul5QppStats.QS_DOC_NAME = Eul5Documents.DOC_NAME
    However, the worksheet data retrieved by Discoverer Oracle's product is not matching my dataset for every workbook. Please suggest.
    Reg
    Thomas

  • IR Dashboard report from new query not getting all Quick Filter selections

    I inherited an IR Dashboard .bqy and my user recently added a new Query, Result, Table, and Report section to it. I cannot get the report to dynamically filter based on the date chosen in the existing Quick Filters section. It seems to be filtering the Location properly (drop down in Quick Filters section), but not the date. Her result section refuses to show anything less than ALL dates from the query.
    The other reports/pivots already on the dashboard work fine with all QuickFilters.
    In my attempt to integrate her new report in to the dashboard I add a new hidden "dummy" pivot (based on the existing query btw, not the new query-could that be the issue? it's dummy though so i figured it was ok), reference this pivot in the Embedded Targets object I found by adding "Object~Pivot4|Type~9|Target~Casket Margin Summary" line,
    went to Dashboard Studio and was able to Associate this report in to the right frame, etc.
    In the script behind the QIQ date "Set Filters" button I saw this code for the existing "Result_Detail" section so I added a line for my new "Results_Merch Detail" section.
    var objServDate = ActiveDocument.Sections["Casket Margin"].Shapes["Service_Date^qiqlbx^showname^a"];
    if (objServDate.SelectedList.Count > 2){
         Alert("Please select only two dates");
         return;
    ActiveDocument.Sections.Item(txlMe.Text).Qiq_onControlClick(this.Parent,this)
    ActiveDocument.Sections["Results_Merch Detail"].Limits["Service Date"].Operator = 11
    ActiveDocument.Sections["Results_Detail"].Limits["Service Date"].Operator = 11;
    I tried it with and without an extra semi-colon at the end of my line. Is that the right way to tell it to apply it to more than 1 Result??
    Worked with this for hours now and can't find whatever else is hidden which tells the QIQfIlter Date to refresh this NEW query/result when chosen.
    I tried to make sure all Filter items exist in the new query's Request line, one was missing. i haven't gone back to Dash Studio since then and re-saved, does THAT matter? I saved the .BQY and re-processed, still no luck.
    can anyone help? I'm desperate for suggestions.
    Thank you!
    Karen

    This has been resolved. The main thing that kept it from working was I kept launching the Dashboard Studio after I was in Design mode so any time I got to the QIQ Filters setup screen it looked like cryptic code and there was nothing to alter or play with to try and force the filters to take effect, so I never changed anything.
    This time I launched the Dashboard Studio while accidentally in regular mode, blessing in disguise. on Step 1 of the wizard I chose QIQ Filter Properties from the configuration drop down list which pops up the Local Filters setup window, now in place of code syntax there was english-like words & action items for me to play around with so I chose my new result set from the drop down list and highlighted all the limits and clicked "Set Filters". Presto, that did it.
    Also I had to make sure all the columns referenced in the QIQ drop down lists and pick list was in my request line in the Query & Result section, repeat the above, and it's all working great now.
    Thanks,
    Karen

  • Not Getting all the icons in the Toolbar while using using ALV with OOPS

    Hello,
    But I am not able to get all the Keys in the toolbar for which i have called the method from class  cl_salv_functions_list, by using the following logic.
    Though i am getting all except Word Processing, ABC Analysis, Save layout, Information, Get Layout.
    FORM ALV_DISPLAY .
      data: lr_functions type ref to cl_salv_functions_list,    "toolbar
            lr_columns type ref to cl_salv_columns,
            LI_COLUMNS TYPE REF TO CL_SALV_COLUMNS_TABLE,    "columns instance
            LI_COL TYPE REF TO CL_SALV_COLUMN_TABLE,        "column instance
            LR_EVENTS TYPE REF TO CL_SALV_EVENTS_TABLE,
            GR_EVENTS TYPE REF TO LCL_HANDLE_EVENTS.
      TRY.                                               "method for ALV display
          CALL METHOD CL_SALV_TABLE=>FACTORY
            EXPORTINg
              LIST_DISPLAY = IF_SALV_C_BOOL_SAP=>FALSE
            IMPORTING
              R_SALV_TABLE = li_alv
            CHANGING
              T_TABLE      = it_po_final.
        CATCH CX_SALV_MSG .
          message e001(00) with text-011.
      ENDTRY.
    *calling methods for toolbar
      lr_functions = li_alv->get_functions( ).
      lr_functions->set_default( abap_true ).
      lr_functions->set_print_preview( abap_true ).
      lr_functions->set_view_excel( abap_true ).
      lr_functions->SET_EXPORT_WORDPROCESSOR( abap_true ).
      lr_functions->set_export_localfile( abap_true ).
      lr_functions->SET_EXPORT_MAIL( abap_true ).
      lr_functions->SET_EXPORT_SEND( abap_true ).
      lr_functions->SET_ABC_ANALYSIS( abap_true ).
      lr_functions->SET_GRAPHICS( abap_true )
      lr_functions->SET_LAYOUT_SAVE( abap_true ).
      lr_functions->SET_DETAIL( abap_true ).
      lr_functions->SET_LAYOUT_MAINTAIN( abap_true )
    *... set the columns technical
      lr_columns = li_alv->get_columns( ).
      lr_columns->set_optimize( abap_true ).
    **get ALV columns
      CALL METHOD LI_ALV->GET_COLUMNS  "get all columns
        RECEIVING
          VALUE = LI_COLUMNS.
      IF LI_COLUMNS IS NOT INITIAL.
    *Get EBELN column
        TRY.
            LI_COL ?= LI_COLUMNS->GET_COLUMN( 'EBELN' ). "get EBELN columns to insert hotspot
          CATCH CX_SALV_NOT_FOUND.
          MESSAGE i001(00) with text-012.
        ENDTRY.
    * Set the HotSpot for ebeln Column
        TRY.
            CALL METHOD LI_COL->SET_CELL_TYPE "set cell type hotspot
              EXPORTING
                VALUE = IF_SALV_C_CELL_TYPE=>HOTSPOT.
          CATCH CX_SALV_DATA_ERROR .
          MESSAGE i001(00) with text-012.
        ENDTRY.
      ENDIF.
    *Register events
    *Event handler method for ALV
    ***handle hotspot click
      LR_EVENTS = LI_ALV->GET_EVENT( ). "get event
      CREATE OBJECT GR_EVENTS.
      SET HANDLER GR_EVENTS->ON_LINE_CLICK FOR LR_EVENTS. "register event handler method
      IF li_alv IS BOUND.        "calling display method for ALV
        li_alv->display( ).
      ENDIF.
    ENDFORM.                    " ALV_DISPLAY

    Hi Neha,
    If you didn't get the answer then follow this one. Yeah and sorry, i checked and found that really you were not getting every icons. I am giving here a sample program.
    REPORT  zdc_factory_alv_test
    TYPES: BEGIN OF ty_vbak,
               vbeln TYPE vbak-vbeln,
               erdat TYPE erdat,
               auart TYPE auart,
               kunnr TYPE kunnr,
            END OF ty_vbak.
    DATA: gt_vbak        TYPE STANDARD TABLE OF ty_vbak,
           gs_vbak        LIKE LINE OF gt_vbak,
           gr_salv         TYPE REF TO cl_salv_table,
           gr_container   TYPE REF TO cl_gui_docking_container.
    START-OF-SELECTION.
       CALL SCREEN '3000'.
    *&      Module  STATUS_3000  OUTPUT
    *       text
    MODULE status_3000 OUTPUT.
       SET PF-STATUS '3000'.
       SET TITLEBAR 'FACTORY'.
    ENDMODULE.                 " STATUS_3000  OUTPUT
    *&      Module  ALV_OUTPUT  OUTPUT
    *       text
    MODULE alv_output OUTPUT.
       PERFORM get_data.
       PERFORM create_container.
       PERFORM display_alv.
    ENDMODULE.                 " ALV_OUTPUT  OUTPUT
    *&      Form  GET_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_data .
       SELECT vbeln erdat auart kunnr
          INTO  TABLE gt_vbak
          FROM  vbak
          UP TO 20 ROWS.
    ENDFORM.                    " GET_DATA
    *&      Form  CREATE_CONTAINER
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM create_container .
       IF gr_container IS NOT BOUND.
         IF cl_salv_table=>is_offline( ) EQ if_salv_c_bool_sap=>false.
           CREATE OBJECT gr_container
             EXPORTING
               side      = cl_gui_docking_container=>dock_at_top
               extension = 2000
             EXCEPTIONS
               others    = 1.
         ENDIF.
       ENDIF.
    ENDFORM.                    " CREATE_CONTAINER
    *&      Form  DISPLAY_ALV
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_alv .
       DATA : lr_columns     TYPE REF TO cl_salv_columns_table.
       DATA : lr_functions   TYPE REF TO  cl_salv_functions_list,
              lr_layout      TYPE REF TO cl_salv_layout,
              ls_layout_key  TYPE salv_s_layout_key.
       TRY.
           CALL METHOD cl_salv_table=>factory
             EXPORTING
               r_container  = gr_container
             IMPORTING
               r_salv_table = gr_salv
             CHANGING
               t_table      = gt_vbak.
         CATCH cx_salv_msg .
       ENDTRY.
       lr_functions = gr_salv->get_functions( ).
       lr_functions->set_all( abap_true ).
       lr_columns = gr_salv->get_columns( ).
       lr_columns->set_optimize( 'X' ).
       lr_layout = gr_salv->get_layout( ).
       ls_layout_key-report = sy-repid.
       lr_layout->set_key( ls_layout_key ).
       lr_layout->set_save_restriction( ).
       gr_salv->display( ).
    ENDFORM.                    " DISPLAY_ALV
    Note:- Double click on screen name '3000' and it will ask you option of creating screen.
    There i have created one module..
    After clicking 3000 under output module create MODULE alv_output.
    That will look like...
    PROCESS BEFORE OUTPUT.
       MODULE status_3000.
       MODULE alv_output.
    PROCESS AFTER INPUT.
    * MODULE USER_COMMAND_3000.
    This is the sample result..
    Still if you have any problem, then feel free to ask..
    Regards
    Dhananjay

  • Not getting all the segments information

    Hi all,
    I am working on IDOC TO IDOC(SAP ECC TO SAP HR). I am sending the Idoc from SAP ECC through WE19. It shows success in the ECC and PI. But in HR I am not geeting all the segments information(WE05). I mean miss some segements info in the HR. I have checked the Meta data its looking fine.
    Can any plz tell me what do i have to do?
    Thanks
    Govinda.

    Hi,
    Log into XI and go to transaction IDX2......Update the metadata of your sender and recievr IDOCs........
    retrigger your IDOC from ECC and see in target system, you get the complete IDOC provided your mapping is also outputting the complete IDOC i.e. take the incoming msg payload from SXMB_MONI and in msg mapping test tab check you are getting the complete IDOC and then in WE05 of target system, check your IDOC.
    Regards,
    Rajeev Gupta
    Edited by: RAJEEV GUPTA on Feb 2, 2009 2:06 PM

  • AP PAYABLES- Not getting all the DUE DATE's in with split schedule payments

    Hello All,
    We have some issues with AP Data loading's into our DW from EBS 11.5.10 AP - PAYABLES.
    One of our customer is using split schedule and share payment into few payment. Our
    sql is not reading all the due dates for PAYABLES.
    We are using PAYMENT_NUM=1 from ap_payment_schedules_all table as condition to load the Data to avoid duplicate rows coming for Payables.
    Some hints: removing the "PAYMENT_NUM=1" from the where clause gives all the due_dates but then we have duplicate rows for Payables.
    Please help to modify our query so that it will work for split schedule payment.
    select
    inv.invoice_num,
    inv.doc_sequence_value,
    sob.currency_code,
    inv.invoice_date,
    'EH'||inv.vendor_id vendor_id,
    'EH'||inv.vendor_site_id vendor_site_id,
    ael.ae_line_number distribution_line_number,
    inv.invoice_currency_code,
    aeh.accounting_date,
    'EH'||ael.code_combination_id code_combination_id,
    nvl(ael.entered_dr,0)-nvl(ael.entered_cr,0) accounted,
    nvl(ael.accounted_dr,0)-nvl(ael.accounted_cr,0) amount,
    fuser.user_name,
    fuser2.user_name user_name2,
    inv.payment_status_flag,
    'PAYABLES' rowtype,
    inv.discount_amount_taken,
    inv.invoice_type_lookup_code invoice_type,
    inv.exchange_rate,
    inv.exchange_date,
    tax.name,
    inv.source,
    inv.attribute6 eflow_doc_id,
    sysdate transfer_date,
    sch.hold_flag,
    inv.cancelled_date,
    sch.due_date
    from
    ap.ap_invoices_all inv,
    apps.ap_ae_headers_all aeh,
    apps.ap_ae_lines_all ael,
    ap.ap_tax_codes_all tax,
    ap.ap_payment_schedules_all sch,
    gl.gl_sets_of_books sob,
    applsys.fnd_user fuser,
    applsys.fnd_user fuser2
    where
    aeh.ae_header_id=ael.ae_header_id and
    inv.set_of_books_id=sob.set_of_books_id and
    inv.invoice_id=sch.invoice_id and
    sch.payment_num*1=1 and ---------------------------------------------- *
    fuser.user_id=inv.last_updated_by and
    fuser2.user_id=inv.created_by and
    ael.tax_code_id=tax.tax_id(+) and
    ael.ae_line_type_code='LIABILITY' and
    inv.invoice_id=ael.source_id and
    ael.source_table='AP_INVOICES' and
    aeh.gl_transfer_flag='Y'
    Thanks,
    Aman

    Hello All,
    We have some issues with AP Data loading's into our DW from EBS 11.5.10 AP - PAYABLES.
    One of our customer is using split schedule and share payment into few payment. Our
    sql is not reading all the due dates for PAYABLES.
    We are using PAYMENT_NUM=1 from ap_payment_schedules_all table as condition to load the Data to avoid duplicate rows coming for Payables.
    Some hints: removing the "PAYMENT_NUM=1" from the where clause gives all the due_dates but then we have duplicate rows for Payables.
    Please help to modify our query so that it will work for split schedule payment.
    select
    inv.invoice_num,
    inv.doc_sequence_value,
    sob.currency_code,
    inv.invoice_date,
    'EH'||inv.vendor_id vendor_id,
    'EH'||inv.vendor_site_id vendor_site_id,
    ael.ae_line_number distribution_line_number,
    inv.invoice_currency_code,
    aeh.accounting_date,
    'EH'||ael.code_combination_id code_combination_id,
    nvl(ael.entered_dr,0)-nvl(ael.entered_cr,0) accounted,
    nvl(ael.accounted_dr,0)-nvl(ael.accounted_cr,0) amount,
    fuser.user_name,
    fuser2.user_name user_name2,
    inv.payment_status_flag,
    'PAYABLES' rowtype,
    inv.discount_amount_taken,
    inv.invoice_type_lookup_code invoice_type,
    inv.exchange_rate,
    inv.exchange_date,
    tax.name,
    inv.source,
    inv.attribute6 eflow_doc_id,
    sysdate transfer_date,
    sch.hold_flag,
    inv.cancelled_date,
    sch.due_date
    from
    ap.ap_invoices_all inv,
    apps.ap_ae_headers_all aeh,
    apps.ap_ae_lines_all ael,
    ap.ap_tax_codes_all tax,
    ap.ap_payment_schedules_all sch,
    gl.gl_sets_of_books sob,
    applsys.fnd_user fuser,
    applsys.fnd_user fuser2
    where
    aeh.ae_header_id=ael.ae_header_id and
    inv.set_of_books_id=sob.set_of_books_id and
    inv.invoice_id=sch.invoice_id and
    sch.payment_num*1=1 and ---------------------------------------------- *
    fuser.user_id=inv.last_updated_by and
    fuser2.user_id=inv.created_by and
    ael.tax_code_id=tax.tax_id(+) and
    ael.ae_line_type_code='LIABILITY' and
    inv.invoice_id=ael.source_id and
    ael.source_table='AP_INVOICES' and
    aeh.gl_transfer_flag='Y'
    Thanks,
    Aman

  • Not getting all the data

    Hi,
    I have the below query, but the output data for the Unavailable column is not showing all the data with a condition_id that's not null.
    Does anyone have any ideas that I might need to try?
    SELECT I.SKU_ID,
    I.DESCRIPTION,
    TO_CHAR(I.EXPIRY_DSTAMP, 'DD-Mon-YYYY') expiry_dt,
    SUM(CASE WHEN I.CONDITION_ID IS NOT NULL THEN QTY_ON_HAND ELSE 0 END) AS Unavailable,
    SUM(CASE WHEN I.CONDITION_ID IS NULL THEN QTY_ON_HAND ELSE 0 END) AS Available,
    P_ILV.SUM_QTY_DUE + (NVL(P_ILV.SUM_TL,0) * NVL(S.USER_DEF_NUM_3,0)) AS Sum_Qty_Due,
    ROUND(ITXN_ILV.AVG_QTY, 2) AS Avg_Qty,
    ROUND(SUM(CASE WHEN I.CONDITION_ID IS NULL THEN QTY_ON_HAND ELSE 0 END)/CASE WHEN ITXN_ILV.AVG_QTY = 0 THEN 1 ELSE ITXN_ILV.AVG_QTY END,2) AS Days_Worth_Stock
    FROM INVENTORY I
    JOIN SKU S
    ON (I.SKU_ID = S.SKU_ID AND I.DESCRIPTION = S.DESCRIPTION)
    JOIN (SELECT P.SKU_ID, SUM (CASE WHEN P.TRACKING_LEVEL NOT LIKE 'C%' THEN P.QTY_DUE ELSE 0 END) AS SUM_QTY_DUE,
      SUM(CASE WHEN P.TRACKING_LEVEL LIKE 'C%' THEN P.QTY_DUE ELSE 0 END) SUM_TL
    FROM PRE_ADVICE_LINE P
    WHERE P.QTY_RECEIVED IS NULL
    GROUP BY P.SKU_ID) P_ILV
    ON (S.SKU_ID = P_ILV.SKU_ID)
    JOIN (SELECT ITXN.SKU_ID, SUM(ITXN.UPDATE_QTY)/(CEIL(TO_DATE($P{To_Date},'DD-Mon-YYYY') - TO_DATE($P{From_Date},'DD-Mon-YYYY')) + 1) AVG_QTY
    FROM INVENTORY_TRANSACTION ITXN
    WHERE ITXN.CODE = 'Shipment'
    AND ITXN.DSTAMP BETWEEN TRUNC(TO_DATE($P{From_Date},'DD-Mon-YYYY')) AND TRUNC(TO_DATE($P{To_Date},'DD-Mon-YYYY')+ 1) - 1/86400
    GROUP BY ITXN.SKU_ID) ITXN_ILV
    ON (S.SKU_ID = ITXN_ILV.SKU_ID)
    GROUP BY TO_CHAR(I.EXPIRY_DSTAMP, 'DD-Mon-YYYY'), I.SKU_ID, I.DESCRIPTION, P_ILV.SUM_QTY_DUE, NVL(P_ILV.SUM_TL,0), NVL(S.USER_DEF_NUM_3,0), ITXN_ILV.AVG_QTY, 2
    ORDER BY I.SKU_IDThanks, Sam.
    Edited by: Sam Mardell on 08-May-2009 06:25

    OK Sam, one thing I would question in the JOIN between INVENTORY and SKU is the JOIN on the DESCRIPTION column - I would reckon that SKU_ID should be enough (and it's not good design to have the DESCRIPTION in more than one place). I think that that could be causing this issue. I've also included the zeroes for NULLs in this.
    Try:
    SELECT I.SKU_ID,
         I.DESCRIPTION,
         TO_CHAR(I.EXPIRY_DSTAMP, 'DD-Mon-YYYY') expiry_dt,
         SUM(CASE WHEN TRIM(I.CONDITION_ID) IS NOT NULL THEN QTY_ON_HAND ELSE 0 END) AS Unavailable,
         SUM(CASE WHEN TRIM(I.CONDITION_ID) IS NULL THEN QTY_ON_HAND ELSE 0 END) AS Available,
         NVL(P_ILV.SUM_QTY_DUE,0) + (NVL(P_ILV.SUM_TL,0) * NVL(S.USER_DEF_NUM_3,0)) AS Sum_Qty_Due,
         NVL(ROUND(ITXN_ILV.AVG_QTY, 2),0) AS Avg_Qty,
         ROUND(NVL(SUM(CASE WHEN I.CONDITION_ID IS NULL THEN QTY_ON_HAND ELSE 0 END),0)/CASE WHEN  TXN_ILV.AVG_QTY = 0 THEN 1 ELSE ITXN_ILV.AVG_QTY END,2) AS Days_Worth_Stock
      FROM INVENTORY I
      JOIN SKU S
       ON (I.SKU_ID = S.SKU_ID)
      LEFT JOIN (SELECT P.SKU_ID, SUM (CASE WHEN P.TRACKING_LEVEL NOT LIKE 'C%' THEN P.QTY_DUE ELSE 0 END) AS SUM_QTY_DUE,
          SUM(CASE WHEN P.TRACKING_LEVEL LIKE 'C%' THEN P.QTY_DUE ELSE 0 END) SUM_TL
        FROM PRE_ADVICE_LINE P
       WHERE P.QTY_RECEIVED IS NULL
       GROUP BY P.SKU_ID) P_ILV
       ON (S.SKU_ID = P_ILV.SKU_ID)
    LEFT JOIN (SELECT ITXN.SKU_ID, SUM(ITXN.UPDATE_QTY)/(CEIL(TO_DATE($P{To_Date},'DD-Mon-YYYY') -  TO_DATE($P{From_Date},'DD-Mon-YYYY')) + 1) AVG_QTY
          FROM INVENTORY_TRANSACTION ITXN
       WHERE ITXN.CODE = 'Shipment'
          AND ITXN.DSTAMP BETWEEN TRUNC(TO_DATE($P{From_Date},'DD-Mon-YYYY')) AND TRUNC(TO_DATE($P{To_Date},'DD-Mon-YYYY')+ 1) - 1/86400
         GROUP BY ITXN.SKU_ID) ITXN_ILV
       ON (S.SKU_ID = ITXN_ILV.SKU_ID)
    GROUP BY TO_CHAR(I.EXPIRY_DSTAMP, 'DD-Mon-YYYY'), I.SKU_ID, I.DESCRIPTION, NVL(P_ILV.SUM_QTY_DUE,0), NVL(P_ILV.SUM_TL,0), NVL(S.USER_DEF_NUM_3,0), NVL(ROUND(ITXN_ILV.AVG_QTY, 2),0)
    ORDER BY I.SKU_ID

  • Not getting all the attributes value from Trusted Recon in eventhandler

    Hi,
    I am not getting the values of all the attributes in hashmap from Trusted recon in eventhandler.
    Following is the hashmap value I am getting :
    Parameter Hashmap value is {re_key=1869, Email=[email protected], Role=Full-Time, act_key=22, User Login=TUser43, Xellerate Type=End-User, Last Name=User43, First Name=Test}
    Please let me know how to get all the attributes value in eventhandler. I need to take some decisions based on these attributes.
    Thanks

    You should be getting all the values in the recon event.
    To get the current user states for all the records in the bulk event use this:
    Identity[] currentUserStates = (Identity[]) eventDataHashMap.get("CURRENT_USER");
    Now when you are looping through your bulkParametersp[], you can use the same get from the currentUserStates:
    Identity currentUser = null;
    currentUser = currentUserStates[counter];
    Now if the attribute is not in your hashmap, you can use:
    currentUserState.getAttributes().get(attribute)
    -Kevini

  • Not getting all the notifications to the Mobile Device

    Hi All,
    We are not able to get all the notifications that are assigned to the mobile device. Only part of the notifications are downloading to mobile device. I can see using MAM30_011_GETLIST there are 195 notifications assigned to that device. Out of 195, I can able to see only 97 notifications on the device.
    I debugged and found that whenever I am creating a notifications using some functional locations either from the backend or using mobile device that never get downloaded to mobile device.
    Please through some light on this issue I would be grateful to you.We are using Server Driven Functionality.
    MAM version is MAM30 SR05.
    Regards,
    Scott.

    Hi,
    The reason is very simple here. Some of the notifications are referring to technical objects(equipment/functional location) which are actaully not present on the middleware. So when a user request for data from the client to the  middleware, because there is a reference from notification to technical objects, middleware will only send those notifications whose all references are actually present on the middleware.
    So the way to check if all the technical objects are present in the middleware or not, you can do the following:
    1. First check the no. of entries for both equipment and functional location in the middleware.
    2. Then later go to the backend, as yours is server driven, then i would say go to variant of technical objects, execute the variant and make a note of the no. of entries it gives.
    3. Verify if both middleware and backend gives same no. of entries.
    If no, then try to correct the replication and then do a sync from the client.
    If yes,  then what I see is, even though you have all technical objects selected as a part of variant, there are still some notifications with technical objects which are not a part of technical objects selection in the above variant.
    So, try to change the variant for technical objects to get more no. of technical objects which covers all the technical objects that might be a part of your notifications.
    Hope this solves your problem.
    Thanks & Best Regards,
    Siva.

Maybe you are looking for