How can define an outer join in the where clause of a flowr statement?

Hi- In the sample below I'm joining two views based on username but in this case what I really want to use is an outer join instead. What is the syntax for that? I tried the (+) notation but that didn't seem to work..
CREATE OR REPLACE PROCEDURE proc_ctsi_all is
XMLdoc XMLType;
BEGIN
DBMS_XDB.deleteResource('/public/CTSI/ctsi_all_rpt1.xml',1);
SELECT XMLQuery(
'<Progress_Report>
<Personnel_Roster>
{for $c in ora:view("CTSI_INVEST_NONPHS_SOURCE_V"),
$cphs in ora:view("CTSI_INVEST_PHS_SOURCE_V")
  let $username  := $c/ROW/COMMONS_USERNAME/text(),
$expertise  := $c/ROW/AREA_OF_EXPERTISE/text(),
$phsorg  := $cphs/ROW/PHS_ORGANIZATION/text(),
$activitycode  := $cphs/ROW/ACTIVITY_CODE/text(),
$username2  := $cphs/ROW/COMMONS_USERNAME/text()
where $username eq $username2
     return
  <Investigator>
   <Commons_Username>{$username}</Commons_Username>
<Area_of_Expertise>{$expertise}</Area_of_Expertise>
<Federal_PHS_Funding>
<Organization>{$phsorg}</Organization>
<Activity_Code>{$activitycode}</Activity_Code>
<Six_Digit_Grant_Number>{$grantnumber}</Six_Digit_Grant_Number>
</Federal_PHS_Funding>
</Investigator>}
</Personnel_Roster>
</Progress_Report>'
RETURNING CONTENT) INTO XMLdoc FROM DUAL;
IF(DBMS_XDB.CREATERESOURCE('/public/CTSI/ctsi_all_rpt1.xml', XMLdoc)) THEN
DBMS_OUTPUT.PUT_LINE('Resource is created');
ELSE
DBMS_OUTPUT.PUT_LINE('Cannot create resource');
END IF;
COMMIT;
END;
/

What you could do is use query within an XMLTable syntax. Via the COLUMNS parameter you then pass the "column" as XMLType to the following XMLtable statement.
little bit like the following
select hdjfdf
from xmltable
   ({xquery}
    PASSING
    COLUMNS xmlfrag xmltype path 'xxx'
   ) a
,  xmltable
   ({the other stuff you need}
    PASSING a.xmlfrag
   ...etc
  ...etc                 I guess something simular can be done via XQuery straight away as well

Similar Messages

  • HT201359 how can i find out what all the charges on my checking account are for?

    how can i find out what all the charges on my checking account are for?

    If you log into your account on your computer's iTunes via the Store > View Account menu option, you should then see a Purchase History section with a 'see all' link to the right of it. Click on that and you should then see a list of your purchases - the most recent purchase is above the list. I'm not sure if that shows auto-renewing subscriptions (I don't have any so I can't check).
    If you can't find the charges and you haven't added or changed your card details on your account (when you do then a small temporary store holding charge may be applied to check that the details are correct and valid, which should disappear within a few days) then you can contact iTunes Support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • How can I sign out or remove the old apple ID in app store's updates?

    I created a new apple id and signed in the app store. When I update my apps, it requires me to sign in with my old apple id, and I cannot sign out my old id. How can I sign out or remove the old id in app store's updates?

    Delete those applications and then download them from the new Apple ID. This may require repurchasing them.
    (100330)

  • Values from a Multi-Select in the where clause of a Select statement

    I have a web page that solicits query parameters from the user.
    The selections that the user makes will populate the WHERE clause of a Select statement.
    One of the controls on the page is a multi-select control.
    When this page posts, I would like to execute a Select statement wherein the selected values from this control appear in the .. Column IN ( <list here> ) portion of the WHERE clause.
    This is an extremely common scenario, but I cannot seem to locate a how-to or message thread that addresses this specific case.
    I have an idea that it may involve dynamic SQL or Execute Immediate, but cannot seem to pin down the answer.
    Any help would be greatly appreciated!

    anonymous - As illustrated here: Re: Search on a typed in list of values
    Scott

  • My storage, it says I have 44.58GB of "other storage"? How can I find out what is the "other" storage and/or delete it?

    HELP! My storage, it says I have 44.58GB of "other" storage. How can I find out what this "other" storage is and/or delete it? I have no space available to update or download the software for my personal cloud.

    About “Other”:
    http://support.apple.com/en-us/HT202867
    Go step by step and test.
    1. Start up in Safe Mode.
        http://support.apple.com/kb/PH11212
    2. Empty Trash.
       http://support.apple.com/kb/PH13806
    3. Disk space / Time Machine ?/ Local Snapshots
      Local backups
       http://support.apple.com/kb/ht4878
    4. Delete old iOS Devices Backup.
        iTunes > Preferences > Devices
        Highlight the old Backups , press “Delete Backup” and then “OK”.
        http://support.apple.com/kb/HT4946?viewlocale=en_US&locale=en_US
    5. Re-index Macintosh HD.
        This will take a while. Wait until it is finished.
        System Preferences > Spotlight > Privacy
        http://support.apple.com/kb/ht2409
    6.Try OmniDiskSweeper. This will give the storage size details of the items.
       https://www.omnigroup.com/more
       Select Macintosh HD and click  “Sweep Selected Drive” at the bottom.
       Delete the files you don’t want to keep.
       Be careful. Delete only the files that can be safely  deleted.

  • TS1702 How can I find out which is the correct app to read a PDF on my iPhone 5?

    I purchased a PDF reader from the app store, but I still cannot read the file. When I try to download the file, it states that I need an updated version of PDF. I notice there are several PDF apps available, but I don't know which is the correct one. How can I find out the correct application I need?

    Select the tune and then - Get Info - in the dialog box is a note of the Apple ID used to purchase.
    MJ

  • How can I find out without opening the box whether my IPAD is a 4th generation with retina display

    ow can I find out without opening the box whether my IPAD is a 4th generation

    Did it fall of the back of a truck? Can't you just ask where you bought it?
    Or check here: http://support.apple.com/kb/ht5452

  • How to change operator of join conditions in where clause?

    Hello
    I have a situation... I want to change the operator between each join conditions in the where clause when these join conditions are not from the same join..
    For example, I have the following schema:
    Dim1 ------ DimA -------Fact1
    Dim1-------DimB -----Fact1
    So DimA and DimB are aliasas of one dim table, but the join is different.
    Now if I run this model, what I will get in the where clause of the query is:
    Where Dim1 = DimA and Dim1 = DimB and DimA= Fact1 and DimB = fact1.
    Is there a way I can change these "and" operator to "OR", so that the where clause would look like this: Where Dim1 = DimA and Dim1 = DimB and DimA= Fact1 OR DimB = fact1?
    This is different from simply changing the join operator within the same join, because these are different joins and I'd like to control how they relate to each other..
    Please help
    Thanks

    Sometimes, business rules are complex, so there isn't always a way to simplify things.  Is your issue that it's complex and error prone, or is it performance due to the OR clauses?
    One possibility that will at least make it easier to test and debug is something like this:  (pseudocode)
    From Table1 Inner join Table2 on x=y etc.etc.
    CROSS APPLY
    (Select case when a=b and (c=d or e=f) then 1 else 0 end) as Situation1
    , case when h=i or j = k then 1 else 0 end) as situation2
    , case when l = m then 1 else 0 end) as situation 3
    ) as CA_Logic_Simplifier
    Where situation1 = 1 and situation2 = 1 and situation3 = 1
    Although you could say, "Hey, this is basically doing the same thing as before", this approach would be far easier to test and debug, because you can at a glance look at the values for situation1, 2, 3, etc. to see where errors are being introduced. 
    The cross apply makes the columns situation1/2/3 "instantiated", so they are usable in the where clause. Divide and conquer.  

  • Using if logic in the where clause of a select statement

    I have a select clause. And in the select clause there is a variable all_off_trt that can be 'Y' or 'N'.
    In the where clause I want to make it so that if a form variable is checked and all_off_trt is 'Y' then
    exclude it else if the form variable isn't checked then select it no matter what all_off_trt is.
    Is there any way to include either and if statement or a case statement within the where clause to acheive this? If not is there another way of doing it?
    Basically I am looking for a case statement like this
    case
    when all_off_trt = 'Y' and mail_para.code = 'Y' then false
    else true
    end
    Message was edited by:
    Tugnutt7

    Ok, so that really doesn't solve my problem. I have 3 different fields that I need to do that with. Each combining in a select statement to print an email list, as well as other thing limiting the where clause.
    This is currently what I have, tested and working 100%.
    cursor email_cur is
         select unique p.email,s.all_off_trt,s.all_deceased,s.no_enroll
    from participant p, trialcom t, ethics s
    where p.status='A'
    and p.surname=t.surname
    and p.initials=t.initials
    and s.trial_cd = t.tricom
    and s.centre = t.centre
    and p.email is not null
    and (t.centre in (select code from mail_parameters where user_name=user and mail_para='CENTRE')
    or 'XX' in (select code from mail_parameters where user_name=user and mail_para='CENTRE'))
    and (t.tricom in (select code from mail_parameters where user_name=user and mail_para='TRIAL')
    or 'XX' in (select code from mail_parameters where user_name=user and mail_para='TRIAL'))
    and (t.role in (select code from mail_parameters where user_name=user and mail_para='ROLE')
    or 'XX' in (select code from mail_parameters where user_name=user and mail_para='ROLE'))
    and (p.country in (select code from mail_parameters where user_name=user and mail_para='COUNTRY')
    or 'XX' in (select code from mail_parameters where user_name=user and mail_para='COUNTRY'))
    and (t.represent in (select code from mail_parameters where user_name=user and mail_para='REPRESENT')
    or 'XX' in (select code from mail_parameters where user_name=user and mail_para='REPRESENT'));
    This is in a program unit that runs when a button is clicked. At the end of that I need to add on the 3 case statements that help further narrow down the selection of emails to be printed. Then it prints the emails selected from this statement into a file. So it has to be done right in the select statement. The three table variables are the all_off_trt, all_deceased, and no_enroll. The form has 3 checkboxes. One for each, that when checked (giving the variable associated with the checkboxes a value of 'Y') excludes all emails that have a 'Y' in the coresponding table variable.

  • How can I figure out, (and control), the sampling rate of my IMAQ board using LabVIEW?

    My IMAQ board is sampling at a certain rate and I do not know what it is... how do I figure this out using labVIEW? Also, how can I make sure that it is not waiting any time at all for sampling i.e. it is not waiting for any wait time functions or any of them other things that cause the program to slow. The reason that I want to do this is because the Kodak Imaging board that I am using seems to be delivering at a much higher rate and no my graph there are major gaps between each sample according to the time plot (for instance it goes from 178280 to 178290 all the way by 10's to 178340. But when the program is running continuously it has gaps of like 355 or so miliseconds I guess.
    Maybe that is just the time that it takes for the program to refresh itself, I am not sure. where could I find where this missing information is going?
    Thanks much,
    Brian

    Brian,
    Your IMAQ card should be sampling at the same speed of the camera, as long as your camera isn't exceeding the cards limits.
    As for how many images you're acquiring in your program, it depends on how long it takes for you to finish one loop of your code. It sounds to me that you may have a lot of processing happening after each grab, therefore slowing down the system.
    Try to comment out your processing (maybe with a case structure set to false) and output only your acquired images. See if that makes a difference. You might also try running this on a faster computer.
    BB_Phil

  • HT5071 when a user buys my ibook in iTunes store, how can I find out more about the user, state purchased in, email it downloaded to, etc ?

    when a purchaser reads my email message in mailchimp, I am provided with the user details, email address used, state located in, etc.....why can't I get the same information from Apple iTunes when a purchaser downloads a paid copy of my iBook from the Itunes bookstore.?????  in order to complete the download of a purchased iBook, that information is gathered by Apple, but is not provided to the iBook author.....any solutions out there...

    All Apple will give you are sales counts and other such general information. Personal information about individual purchases will not be available to you.
    Regards.

  • Why is my internal memory so full? How can I find out what is the "other" that is taking up so much space?

    I'm not very tech-savvy. My iPhone is backed up on my computer and all my photos are in my computer. I'm going to send it away to have the screen fixed and the people from AppleCare recommended to back it up just in case. So, I am going to backup my computer for the first time since I bought it in mid 2011. I go see how much space I need and I see that I only have 15 GB of memory space left and this huge space being used up by "Other". I don't know if its because I updated it to Mavericks. How can I see what that is? Also, I've never downloaded movies so I don't know why that is also there. Please help ASAP!
    I added a photo.

    "Other" is everything that isn't in one of the other categories. For instance, it includes all your user documents that are not movie, audio, or photo files.
    Regardless of that, you need to use an external drive at least large enough to backup your entire user folder (the one with a House icon). Better is to get one at least as large as your built-in drive & use something like Carbon Copy Cloner or SuperDuper! to clone the whole built-in drive to it.

  • Outer join with a WHERE clause

    hi, this is driving me round the bend. I thought i was ok with sql joins and the like, but im really struggling on this one.
    I have table A (for argument sake tblRegion) and table B (tblBranch). if i want to return everything i would do something like this:-
    select * from tblRegion join tblBranch on tblRegion.id=tblBranch.reg_id.
    If i wanted to return all regions even if they do have a branch associated i would do something like this:-
    select * from tblRegion left outer join tblBranch on tblRegion.id=tblBranch.reg_id.
    My problem is, I want to return all Regions and use a WHERE clause to narrow the Branch results.
    I've tried something like this but it doesnt work
    select * from tblRegion left outer join tblBranch on tblRegion.id=tblBranch.reg_id WHERE branch.name like 'LONDON%'
    Is there anyway i can return all branches where name is like LONDON, and STILL return all Region if there is no data for that Region?
    Do i need to use a nested select statement maybe?
    Many thanks in anticipation somebody will save me from my current madness. David

    Check this link. It explains the most common problem/coding error while using outer join.
    http://www.orafaq.com/node/855
    Effectively in your case you need the following condition in your where clause
    where nvl(branch.name,'LONDON') like 'LONDON%'
    Hope that helps.
    Regards
    Raj

  • How to use multiple search conditions in the where clause

    Hi,
    Below is my query
    /****** Script for SelectTopNRows command from SSMS  ******/
    SELECT distinct 
    ctacct,sum(GLMN02)
      FROM [ODS].[Staging].[tODS_INF_GLPCT]
      inner join 
      [ODS].[Staging].[tODS_INF_GLPGL] ON tODS_INF_GLPCT.CTPAGE = tODS_INF_GLPGL.GLPAGE
      where 
      CTACCT like '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4110%'
    This one gives me the exact result i want, now if i add one more to my where clause like this
    /****** Script for SelectTopNRows command from SSMS  ******/
    SELECT distinct 
    ctacct,sum(GLMN02)
    --,ctdesc,CTPAGE
    --SUM(GLMN02)
      FROM [ODS].[Staging].[tODS_INF_GLPCT]
      inner join 
      [ODS].[Staging].[tODS_INF_GLPGL] ON tODS_INF_GLPCT.CTPAGE = tODS_INF_GLPGL.GLPAGE
      where 
      CTACCT like'[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4110%' or
      CTACCT like '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4115%'
    This query doesnt give me the exact values instead it gives me all the weird values.Can someone please help me with how to work on this where clause?
    Thanks

    Hi Patrick,
    This is what i ve tried earlier and it isnt working .If i use the first query
    /****** Script for SelectTopNRows command from SSMS  ******/
    SELECT distinct 
    ctdesc,SUM(GLMN02)
    --,ctdesc,CTPAGE
    --SUM(GLMN02)
      FROM [ODS].[Staging].[tODS_INF_GLPCT]
      inner join 
      [ODS].[Staging].[tODS_INF_GLPGL] ON tODS_INF_GLPCT.CTPAGE = tODS_INF_GLPGL.GLPAGE
      where 
     CTAcct LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4110%'
       --OR
       --CTAcct LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4115%'
      and GLYEAR = 2014
      and CTDESC = 'Sales'
      group by ctdesc
    The result set is 
    Sales                        
    -182273.96
    And if i use the second query
    SELECT distinct 
    ctdesc,SUM(GLMN02)
    --,ctdesc,CTPAGE
    --SUM(GLMN02)
      FROM [ODS].[Staging].[tODS_INF_GLPCT]
      inner join 
      [ODS].[Staging].[tODS_INF_GLPGL] ON tODS_INF_GLPCT.CTPAGE = tODS_INF_GLPGL.GLPAGE
      where 
     CTAcct LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4110%'
     OR
       CTAcct LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4115%'
      and GLYEAR = 2014
      and CTDESC = 'Sales'
      group by ctdesc
    The result set i get is 
    Sales                        
    -1455441.08
    And i verified that  CTAcct LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-63020-4115%'
    this second line of where clause has not desc as Sales.
    I am not sure whats causing the difference in the values.
    Can you please help me with this?
    Thanks

  • How can I add left join in the coding

    I intend to dynamic add left jion in my java class.
    so I write the coding like below:
    incident_id = svc_yokyu_id(+)
    (Both of them have been selected in the select sentence.)
    However, when I run the app, it will throw a sql error.(ora-01416)
    then I copy the error sql sentence and try to test it
    QRSLT WHERE (incident_id = svc_yokyu_id(+))--this is a error sql sentence.
    Finding that if I delete the left join,(+), the sql will run right,
    or I modify the sql like
    QRSLT WHERE incident_id in (Select svc_yokyu_id from xxfm_srl_sr_jc_relation xssjr where incident_id = xssjr.svc_yokyu_id(+)) , it run right as well.
    according to bussiness requestion, I can't write the coding like above,
    so, i don't know how to implement it.
    and i hope to your advice. thx

    Does a hand come out of the screen, grabbing you by the wrist, every time you try?
    Just guessing…
    Peter

Maybe you are looking for

  • [SOLVED] Unable to boot Archiso USB in UEFI mode

    Hello Everyone ! I'm trying to create an UEFI bootable USB from the latest ISO : 2012.10.06. I first tried following this section of the wiki : https://wiki.archlinux.org/index.php/Un - B_from_ISO with an usb key formatted as an EFI System (of type "

  • I cant erase my hard drive and clean install OS X 10.6

    When I try and do a clean install from the OS X disk I do not get the option to use disk utilities to erase the disk. Does anyone know why this is missing, could I have some sort of virus blocking it?

  • Acrobat XL Pro Upgrade

    I had XL standard on my laptop. i just purchased XL Pro to upgrade and im getting this message at startup "Serial Number you provided is valid, but a qualifying product could not be found on this computer.

  • Simple drag and drop programme. Bug

    Hi. I have a simple drag and drop app for learning English. You hear for eg: banana and have to drag that object to a certain area. When my little kid plays it she finds bugs - she's my researcher. It's hard to explain the bug as its hard to get it b

  • Question for xcelsius and widget

    Hi, experts. Today i have one question i'm trying to make the widget by using Adbe(air)..and i can make it! However, I wonder if i can use the SAP BW conncection . if so, what am I supposed to do ?? I'm strugring and trouble with making the widget ha