Outer join doesn't retrieve the correct values

Hi, I have a problem to retrieve some data from this query with the outer join:
select count(incident_id),range_2 from
(select range_2 from apps.aaa_table) a,
(Select inc.incident_id,
XXN2B_RESOLUTION_RANGE(2,ROUND(( (TO_DATE(inc.INCIDENT_ATTRIBUTE_7,'dd/mm/yyyy hh24:mi:ss')-inc.INC_RESPONDED_BY_DATE)*24 ),2)) RANGES
,inc.CATEGORY_ID
, inc.INVENTORY_ITEM_ID,
prom_dt.Iptv_Sumptom --S?µpt?µa
FROM cs_incidents_all_b inc,
cs_incidents_all_tl tl,
cs_sr_type_mapping m,
fnd_responsibility resp,
xxntt.xxntt_incidents_support ntt,
xxntt.xxntt_incidents ntt_inc,
xxe.xxe_tt_promitheas_dt prom_dt,
xxe.Xxe_Cs_Int_Sla sla
WHERE inc.incident_id = tl.incident_id
AND tl.LANGUAGE = 'EL'
AND inc.incident_type_id = m.incident_type_id
AND resp.responsibility_key IN (select SV.FLEX_VALUE from fnd_flex_value_sets s, FND_FLEX_VALUES SV
where s.FLEX_VALUE_SET_NAME = 'XXNTT_RESPONSIBILITIES'
AND S.FLEX_VALUE_SET_ID = SV.FLEX_VALUE_SET_ID)
AND m.responsibility_id = resp.responsibility_id
AND resp.end_date is null
AND inc.incident_number = ntt.incident_number(+)
AND inc.incident_number = ntt_inc.incident_number(+)
AND inc.incident_id = prom_dt.incident_id(+)
AND inc.incident_number = sla.Incident_Number(+)
--and TOTAL_INACT_SLA_DURATION  not like '%0:00%'
and (inc.INC_RESPONDED_BY_DATE is not null AND INCIDENT_ATTRIBUTE_7 is not null)
) b,
(select * from xxntt_custom_hierarchy
union
select null eidos, null omada, null product_categiory, null category_id, null inv_item_descripiption, null symptom, null tautopoihsh, null inv_item_id from dual
) c
where a.range_2 = b.ranges (+)
and c.INV_ITEM_ID (+) = b.INVENTORY_ITEM_ID
and c.CATEGORY_ID (+) = b.CATEGORY_ID
and c.SYMPTOM (+) = b.IPTV_SUMPTOM
and c.OMADA = 'A'
group by range_2
This query is composed by 3 dataset: a, b, and c
the dataset a is a fixed list of values (LOV): range_2 = '0-2h','2-4h','4-6h','6-8h','8-10h','10-12h','12-14h','14-16h','16-18h','18-20h'
the dataset b retrieve the list of the incident_id's and their related ranges (calculated with the function XXN2B_RESOLUTION_RANGE)
the dataset c is just a filter on the the dataset b to retrieve only the incident_id's who belong to the Group 'A'
Want I want to achieve is this: see always the complete list of values 'range_2' even if I don't have incident_id with a particular range.
For this reason I put the condition: a.range_2 = b.ranges (+)
....but this doesn't work....I see ONLY the incident_id which have the range inside the LOV......instead I want to see also if there are incident_id without a range in the LOV.
Grouping by range_2, I see:
!http://www.freeimagehosting.net/uploads/d900035c11.jpg!
instead of
!http://www.freeimagehosting.net/uploads/99a75dfca4.jpg!
Anybody can help me to understand where is the mistake ???
Thanks in advance
Alex

Hi, Alex,
Whenever you ask a question, post a little sample data (CREATE TABLE and INSERT statements) for all the tables (relevant columns only), as well as the results you want from that data.
When you post formatted text on this site (and code should always be formatted) type these 6 characters:
{code}
(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
If you're using a + sign next to some column from table c, then all conditions involving table c need to have a + sign; otherwise, you cancel the effect of the outer join.
Change
and     c.OMADA      = 'A'to
and     c.OMADA (+)  = 'A'That may be all you need. If not, post the sample data and your formatted query.

Similar Messages

  • Query does not retrieves the correct values

    Hi,
    pls look into the code.
    clear: wf_etenr,
             vbep.
    To get the Scheduled Loading date and Scheduled Arrival Date.
        SELECT MAX( etenr ) FROM  vbep INTO wf_etenr
                            WHERE vbeln = tvbdpl-vgbel
                            AND   posnr = wl_posnr.
        IF sy-subrc EQ 0.
          clear vbep.
          SELECT SINGLE * FROM vbep         "R02
                 WHERE vbeln = tvbdpl-vgbel "R02
                  AND posnr = tvbdpl-vgpos  "R02
                  AND etenr = wf_etenr.
          IF sy-subrc EQ 0.
    when i see the values at dictionary level using the same wher conditions are mismatching with the query excution result in the program.
    here in the second query ( SELECT SINGLE * ) it giving the wrong results .
    if i compare the results at table level ,some of the field values are missing after excuting the above second query.
    pls can any one give me ur suggestion on this !
    rgds
    sanjay reddy

    Hi,
    are these the same?
    wl_posnr and tvbdpl-vgpos
    try
    SELECT SINGLE * FROM vbep
    WHERE vbeln = tvbdpl-vgbel
    AND posnr = wl_posnr
    AND etenr = wf_etenr.
    IF sy-subrc EQ 0.
    to make somewhat consistent querys.
    regards
    Message was edited by: Zlatko
            Zlatko Stracenski

  • Outer join doesn work

    The prob with this query is, it has to list the pono for grnno,which contains null value,but outer join doesn work on this, and it list values only for grnno that contains value please help to solve this prob
    SELECT pv.vendor_name, pv.segment1 vendorid, ph.segment1 pono, pl.line_num,
    ph.creation_date po_date, pl.quantity orderqty,
    pll.quantity_received, pl.unit_price, rcv.receipt_num grn_no,
    rct.creation_date item_recd_date, rct.quantity, ph.currency_code,
    item.segment1 itemcode, pl.item_description description,
    ph.attribute1 po_type
    FROM po_headers_all ph,
    po_lines_all pl,
    po_vendors pv,
    po_line_locations_all pll,
    rcv_shipment_headers rcv,
    rcv_transactions rct,
    mtl_system_items item
    WHERE item.inventory_item_id = pl.item_id
    AND item.organization_id = pl.org_id
    AND ph.authorization_status IN ('APPROVED')
    AND NVL (ph.cancel_flag, 'N') = 'N'
    AND NVL (pl.cancel_flag, 'N') = 'N'
    AND pl.po_header_id = pll.po_header_id
    AND pl.po_line_id = pll.po_line_id
    AND pl.org_id = pll.org_id
    AND rcv.shipment_header_id = rct.shipment_header_id
    AND pl.po_header_id = rct.po_header_id
    AND rct.po_line_id = pl.po_line_id(+)
    AND pl.po_header_id = ph.po_header_id
    AND pv.vendor_id = ph.vendor_id(+)
    AND TRUNC (ph.creation_date) >= '06-MAY-2006'
    AND TRUNC (ph.creation_date) <= '29-MAY-2006'
    AND rct.transaction_type = 'RECEIVE'
    ORDER BY pono

    This is one that always confuses me - do you need to outer join all references to the table? ie :
      1  select d.deptno,d.dname
      2  ,e.empno,e.ename
      3  from dept d,emp e
      4  where d.deptno = e.deptno(+)
      5  and d.dname like '%S%'
      6* and e.ename like '%A%'
    SQL> /
        DEPTNO DNAME               EMPNO ENAME
            30 SALES                7499 ALLEN
            30 SALES                7521 WARD
            30 SALES                7654 MARTIN
            30 SALES                7698 BLAKE
            20 RESEARCH             7876 ADAMS
            30 SALES                7900 JAMES
    6 rows selected.
    SQL> edit
    Wrote file afiedt.buf
      1  select d.deptno,d.dname
      2  ,e.empno,e.ename
      3  from dept d,emp e
      4  where d.deptno = e.deptno(+)
      5  and d.dname like '%S%'
      6* and e.ename(+) like '%A%'
    SQL> /
        DEPTNO DNAME               EMPNO ENAME
            20 RESEARCH             7876 ADAMS
            30 SALES                7654 MARTIN
            30 SALES                7900 JAMES
            30 SALES                7521 WARD
            30 SALES                7499 ALLEN
            30 SALES                7698 BLAKE
            40 OPERATIONS
            60 TEST
            70 TEST
    9 rows selected.

  • Entering a Value and Tabbing out of af:inputListOfValues displays the wrong value

    Good morning. I am having an issue with the autosubmit and tabbing out of af:inputListOfValues in my code.
    Problem: When I type in a valid value and tab out of the field, it ignores the value I entered and displays whatever the first list in the query result instead regardless of the value I typed.
    My code snippet. What it does is simply an LoV search of Employee No attached to an entity attribute and depending on selection, it will display the Employee Name within the page. (it also retrieves a table view depending what employee number was entered)
    <af:inputListOfValues id="empNoId"
                 popupTitle="Search and Select: #{bindings.EmpNo.hints.label}"
                  value="#{bindings.EmpNo.inputValue}"
                  label="#{bindings.EmpNo.hints.label}"
                  model="#{bindings.EmpNo.listOfValuesModel}"
                  required="#{bindings.EmpNo.hints.mandatory}"
                  columns="#{bindings.EmpNo.hints.displayWidth}"
                 shortDesc="#{bindings.EmpNo.hints.tooltip}"
                   binding="#{workLocationBean.txtEmpNo}"
                  partialTriggers="id1"
                 valueChangeListener="{bean.onEmpNoChange}"    
                 autoSubmit="true">
            <f:validator binding="#{bindings.EmpNo.validator}"/>
      </af:inputListOfValues>
    Other things to note:
    When I enter a valid employee number and click anywhere in the page (not TAB), it behaves correctly.
    I have been trying to figure this out for days. Even my valueChangeListener gets the wrong value (when I do System.out) when I tab out so I am not sure where to catch it and replace it with the correct value.
    Thank you.

    This usually happens when primary key is not set in view object used by LOV.
    Dario

  • News feed on my Facebook app doesn't show the correct time. Can the time be set?

    News feed on my Facebook app doesn't show the correct time.  Can the time be set?

    Does your phone show the correct time?
    If not, change the time on your phone, see if it helps.
    If it does, then sign out, sign back in. If that fails, the delete and reinstall. If that fails, then contact Facebook, as they're the developers of the app and will have the proper documentation to help you further.

  • How to filter certificate templates in Certificate Authority snap-in with the correct values

    How to filter certificate templates in Certificate Authority snap-in with the correct values
    I have a 2012 R2 server running Microsoft Certificate Authority snap-in.
    I want to do a filter on a specific Certificate Template which i know exists in the 'Issued Certificates' folder.
    All the documentation i can find seems to suggest i copy the certificate name and use this in the View Filter.
    1). I add the 'Certificate Template' option into the Field drop-down.
    2). I leave the Operation as the '=' symbol
    3). I paste in just the name of the template in question. for example: 'my computers'
    The search results always come back blank 'There are no items to show in this view.' even when i know there are many instances of this template. I've tried on a win 2008 server and same issue.
    Is there a correct value to enter for the Certificate Template name?
    Can this be done easier using certutil commands?
    When i run the certutil tool i can confirm i have several issued templates. Certutil -catemplates -v > c:\mytemplate_log.csv
    Anybody know what i'm doing wrong?
    I seem to be getting nowhere with this one.

    > But its important you are using the template name, not the display name
    this is incorrect. OIDs are mapped to *display name*, not common name (it is true for all templates except Machine template). That is, in order to translate template name to a corresponding OID, you need to use certificate template's display name. And, IIRC,
    template name in the filter can be used only for V1 templates. For V2 and higher, OID must be used.
    My weblog: en-us.sysadmins.lv
    PowerShell PKI Module: pspki.codeplex.com
    PowerShell Cmdlet Help Editor pscmdlethelpeditor.codeplex.com
    Check out new: SSL Certificate Verifier
    Check out new:
    PowerShell FCIV tool.

  • Keyboard doesn´t use the correct symbols

    Using the shift key doesn´t produce the ´correct´ symbol. For example, SHIFT + 2 produces " rather than @. (To type this I had to type it out in word first, where the shift key does work normally, and copy and past in this Details box. From left to right on the keyboard, these are the symbols I get with the shift key
    §"#$%&_()'?
    As you can imagine this makes it very difficult and irritating to work in firefox.
    Hopefully you have a solution for this.
    Thanks, Jane

    It is possible that you have switched the keyboard layout by accident by using the key sequence to rotate the keyboard layout.
    * http://support.microsoft.com/kb/258824 - How to change your keyboard layout
    Windows remembers the keyboard layout setting per application and you may have changed the keyboard layout by accident via a keyboard shortcut.
    * http://windows.microsoft.com/en-US/windows7/The-Language-bar-overview The Language bar (overview)
    * Make sure that you have the Language bar visible on the Windows Taskbar
    * You can do that via the right-click context menu of the Taskbar: Toolbars > Language Bar
    * Check the keyboard language (keyboard layout) setting for the application that has focus via the icon on the Language bar
    * You need to do that while Firefox has focus because Windows remembers the keyboard layout setting per application
    * The default key combination to rotate the layout is the Ctrl+Shift or Alt+Shift combination that is used in Firefox for menu items, so it is possible to change the layout accidentally.
    * To avoid an unintentional switch, assign a specific key sequence (Alt/Ctrl+Shift+number) to select keyboard layouts and remove the key combination to rotate layouts (Alt+Shift or Ctrl+Shift)
    * Control Panel > Regional and Language Options > Keyboards and Languages > Change keyboards > Advanced key settings > Change key sequence

  • Control not outputting the correct value

    Hello,
    I have a producer consumer architecture with a queue to pass values. I want to push a new value onto the array using "Insert into Array" when a button is pressed, but when I do the previous value is being read the first time and the correct value on the second press.
    I'm self taught and it's my first time using the queue so maybe something I'm not seeing/thinking about there?
    Version 8 VI Attached.
    Do this to see the problem:
    1. Run
    2. Click "Master Read"
    3. Change "Value"
    4. Click "Master Read"
    5. Click "Master Read"
    Any help is appreciated including block diagram critique.
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Untitled 1.vi ‏16 KB

    It all depends on how you change the value of "Value". If you use the increment and decrement buttons it works as you expected.
    If however, you type in a new value and click the button without clicking somewhere else first, it doesn't work - and here's why:
    When you type in a value that modified value doesn't show up in the code untill the control loses "key focus". The problem is that clicking the button does cause the numeric input to lose key focus but only after the code has responded to the mouse up event.
    To fix the problem put a property node in the mouse down event to set the numeric's KeyFocus property to false before the value is enqueued.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to retrieve the procedure value and pass the value to a form field

    How to retrieve the procedure value and pass the value to a form field?

    Set property for the field and the value is the actual procedure/function.
    Cheers

  • Calendar Third Sunday of February doesn't show the correct day in all years

    Calendar Third Sunday of February doesn't show the correct day in all years?
    The day of month repeats the same day as saturday.
    Example: February 20 2010= Saturday. Sunday shows 20 and not 21.
    February 19 2010= Saturday. Sunday shows 19 and not 20...
    I'm in Brasil, where DST begins exactly on the third sunday of February (coincidence?)...But the problem persists even if I deactivate the hour fuse control !

    Yes, it's a DST issue. I've had this problem before at both ends of DST.
    You can submit feedback to Apple: http://www.apple.com/feedback/iphone.html.

  • Alerts not retrieving the correct number of records

    Hi,
    I have created alerts to run plans. These plans are getting records from DB and populating the ADC. The alerts are getting executed but are not retrieving the correct number of records.
    I have created 5 alerts to run 5 plans all in the same time. The error at the "Data Flow service status" window is :
    CACHED RESULT
         REQUEST ID: {4EB6B955-96B3-4AF2-B836-6C9F417D47A6}
         EXECPLAN ID: {11372B4D-9ACE-4CFB-831F-11028FF996D5}
         EXECPLAN NAME: xxxx
         FIX COUNT: 0
         START TIME: 6/8/2006 12:00:01 PM
         EXECUTION TIME: 0:00:00
         Sink Records Blocks Disk Blocks Fix Count Hit Count Execution Status
         0: 0 0 0 0 0
    Complete - ERROR Error while processing the data for the step 'SQL Query'
    This error is seen for 2-3 plans .......
    But if i execute the plan manually from design studio there is no error.
    So
    1. Do i need to change anything in the config files to increase the MAx memory block?
    2. Is there any way, the plans can be run one at a time i.e. configure alerts in such a way that if one plan finishes the other one starts automatically? Currently i have scheduled the plans to run at the same time using Alerts..
    Please help...
    Thanks

    Here is one 'culprit' you can verify. Open DesignStudio. You should "--not--" see any grids or icons on (near) the botton status row. If you see them - right click and delete them. These are plans with same_names put in 'locked' state. After you do this. close your design studio.
    Note- if you ever open a plan in designstudio, always "save" it and close it (exit). Donot click on window [x] mark to close the appl.
    After above verifrication -- restart EnterpriseLink and restart PlanMonitor, verify if everything runs fine.
    --sanjeev                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • "An error occurred while attempting to retrieve the KPI value from the list"

    Hi all.
    when I used KPI, this error occured:
    An error occurred while attempting to retrieve the KPI value from the list
    what happened?
    any suggestion.
    thanks.

    Hello,
    Unfortunatly, I don't have the option to re-create my SP list.  I have created my KPI list in the same site as the targeted list.  I have made all items available in the list view, I've tried several different list views, I still get the
    An error occurred while attempting to retrieve the KPI value from the list.
    message. 
    I am at a loss here, I've search the internet high a low and haven't found any helpful info. 
    In MOSS 2007 I've created a list with about 24 columns.  I need a KPI based on one of the columns.  I've tried to creat a view with that one column, I've tried to creat a view with all columns
    and make it the defualt column...  I don't know what else to try here.
    Any help would be very appriciated!
    Cheers,
    ~Bryan

  • How do you retrieve the USR_LOCK value?

    How do you retrieve the USR_LOCK value, it cant be mapped directly on the process task right?
    You writed custom JAVA code?
    Thanks in advance.

    If by any change you want this with 11g APIs then you can use http://docs.oracle.com/cd/E14571_01/apirefs.1111/e17334/oracle/iam/identity/usermgmt/vo/User.html#getManuallyLocked__ and http://docs.oracle.com/cd/E14571_01/apirefs.1111/e17334/oracle/iam/identity/usermgmt/vo/User.html#getAccountLockedDate__
    HTH,
    Bikash

  • Retrieving  the score value from the captivate into flash

    Hi,
    We have used Captive 2 to built course & publishing it as
    a non e-learning output
    and loading the published swf file in custom built flash
    movie (wrapper).
    We have accessed some of the captivate variables to control
    the captivate swf.
    Does anyone know how to retrieve the score value from the
    captivate into flash ?
    Thanks
    Regards
    Chetan

    Hello,
    Use the Object Browser in .NET and search on "Summaryinfo" and you'll find the API to use.
    Thank you
    Don

  • How do I display the correct value when using SELECT_LIST_FROM_QUERY

    I have an updatable report that displays the possible values for a field.
    I'm using HTMLDB_ITEM.SELECT_LIST_FROM_QUERY, so obviously I have to process the record manually.
    However, I need the trick to display the correct value as selected before processing the records.
    I appreciate your help.
    Thanks
    Juan

    Thank you.
    So, I just need to put the field name in the second argument.
    I have it working now.
    Thanks again
    Juan

Maybe you are looking for