XMLQuery FLWOR where expression

Hello

I would like to know if there is a way to extract all values in a table that are not in a second table with xmlquery, for example:

CREATE TABLE ZZZTEMP (TEMP INTEGER, PROVA VARCHAR2(100));
INSERT INTO ZZZTEMP
VALUES(1, 'A');
INSERT INTO ZZZTEMP
VALUES(7, 'B');
COMMIT;


CREATE TABLE ZZZTEMP2 (TEMP INTEGER, PROVA VARCHAR2(100));
INSERT INTO ZZZTEMP2
VALUES(1, 'A');
INSERT INTO ZZZTEMP2
VALUES(8, 'B');
COMMIT;


SELECT XMLQuery('for $i in ora:view("zzztemp")/ROW/TEMP
                   for $y in ora:view("zzztemp2")/ROW/TEMP
                   where $i != $y
                     return <a>{$i}</a>'
                    RETURNING CONTENT) AS col
FROM DUAL;

In this scenario, the

where $i = $y

Returns only 1; but the

where $i != $y

Returns 1, 7, 7. Is there a way to return only (once) 7 (the only value that is not in the zzztemp2 table)? Something like: where $i not in $y.

Thank you

Igor

I used fn:collection() because as ora: view() is discouraged.

While the owner was optional and not reimbursed to the current schema when using ora:view (), with fn:collection (), you must use the schema oradb like this:

"oradb: /OWNERGuide.

I used my own scheme ('DEV') in my example, so replace it with yours and it should be OK.

Note that this also works with PUBLIC synonym if one has been created, for example "oradb: / PUBLIC/TABLE".

Tags: Database

Similar Questions

  • Oracle: how to use the max() function in expression box

    How to use the max() function in the case where expression, please explain with an example

    Hope this helps and should be explicit

    with t as
    (select 1 col,100 col2 from dual union
    select 2 ,100 from dual union
    select 2 ,200 from dual union
    select 3,100  from dual union
    select 3,200  from dual  )
    select col, case when max(col2)=100 then 'with 100 range'
    when  max(col2)=200 then 'with 200 range' end  from t group by col
    
  • Problems ZBook 15 mSata detection

    I have a brand new 15 ZBook with a 180 GB mSata SSD (SSDMCEAW180A401) INTEL and a 750 GB HARD drive. MSata SSD lies in the operating system (Windows 7), the bios is set to legacy, quick start is off, and the only startup option selected is msata. The multiboot menu is also set to 5 s (just to see what devices are available, facilitating the diagnosis).

    Turn on the laptop, boot Express options show mSata and portable hard drive, after 5 seconds, the mSata operating system starts and all is well. While in Windows, choose the stop, the laptop stops and then turn it back on, everything is the same that previously, Express boot options display mSata and Windows starts after 5 s.

    Now, here's the problem:

    Choose restart in Windows restarts the mobile computer, see Startup Express options, but the mSata is missing. Only the hard drive of the laptop appears and after 5 seconds I get not found Bootdevice! Pressing on enter, the laptop restarts again and terminal as HP PC Hardware Diagnostics (UEFI) appears. Choosing output and confirming the laptop restarts again, the startup options Express stil show only the Notebook hard drive and the process repeats. The only way out is to press the power button, and after he died. Turn it back on, the spectacle of Diagnostics of material for the PC HP (UEFI) upward and out there, startup options Express redisplay mSata and the system boots.

    Seems to me as it is a BIOS problem - in restart mode, it does not detect the mSata drive. If it is in cold start mode. Maybe the mSata SSD is not yet completed initialization at the point where Express boot options go up and there should be a delay of some sort.

    It gets very frustrating because the updates will restart the PC and it won't come back without my intervention. Having updates disabled is not an option.

    Help please!

    Thank you

    JerryPi

    Hello

    To solve your problem, you must ensure that the SATA device is set to RAID, you can find it in the Menu advanced-> device-> peripheral Mode SATA Configurations.

    I think that the problem is due to the implementation of HP with intel uses of wich cached smart answer only the msata ssd SSD should work only with a HARD drive and requires Sata in RAID mode.

    So in the Zbooks with msata ssd that you must make sure to keep it in RAID mode. Also HP does not support the msata with ssd sata ssd, and I do not think that it supports the use of the msata ssd other other uses the cache.

    Also, if you want to use Intel SRT the maximum size of the cache can be used on the msata SSD is 64 GB.

    Best regards

  • issue of extract XMLType column

    my xml looks like one below, I am able to get the value of @emp-type using as described below, but not able to get @depName

    declare

    xmlDoc xmltype: = XMLTYPE. CREATEXML ("<?") XML version = "1.0" encoding ="UTF - 8"? >

    < comp: emp - def xmlns:comp = "some.namespace.uri" >

    < comp: def >

    < comp: emp-spec type emp = 'Manager' >

    < comp: spec xsi: Nil = "true" xmlns:xsi="some.namespace.uri"/ >

    < / model: emp-spec >

    < comp: emp-att-spec >

    a model of < comp: cond > < / model: cond >

    < comp: emp - det depName 'BUY' = age rank = "8" = "" / >

    < / model: emp-att-spec >

    < / model: def >

    (< / model: emp - def > ');

    RES varchar2 (300);

    Start

    ("Select extractvalue (xmldoc,'/comp:emp-def/comp:def/comp:emp-spec/comp:emp-att-spec/comp:cond/comp:emp-det/ @depName xmlns:comp ="some.namespace.uri"," "")

    in res

    Double;

    dbms_output.put_line('res...');

    dbms_output.put_line (res);

    end;

    ExtractValue (and xmlsequence) are deprecated XML features.

    To retrieve XML using SQLX data use XMLTABLE or XMLQUERY with XQuery expressions, as...

    SQL > ed
    A written file afiedt.buf

    1 with t as (select XMLTYPE ('))
    2
    3
    4
    5
    6

    7
    8 dummy
    9
    10

    11

    12
    ') in the XML of the double)
    13-
    14. end of test data
    15-
    16. Select x.*
    17 t
    18, xmltable (xmlnamespaces (' ' a few .uri .namespace ' like 'comp'),)
    19 ' computer: emp - def / model: def'
    20 passage t.xml
    path of 21 columns emp_type varchar2 (10) '. / comp:emp-spec/@emp-type'
    22 road of varchar2 (10) cond '. / model: emp-att-spec / model: cond'
    23 road of varchar2 (10) of depName '. / comp:emp-att-spec/comp:emp-det/@depName'
    24, path number rank '. / comp:emp-att-spec/comp:emp-det/@grade'
    25 road number age '. / comp:emp-att-spec/comp:emp-det/@age'
    26*                ) x
    SQL > /.

    EMP_TYPE COND. DEPNAME AGE GRADE
    ---------- ---------- ---------- ---------- ----------
    dummy Manager PURCHASE 8

    Note: I assume this model: def is the repeating group in this example.  If that contains other repeating groups while he would need other XMLTABLE expressions with a passerby content repetition across groups to effectively create a Cartesian results product.

  • How to trigger a conditional display based on a dynamic Action without submitting the Page

    Hello

    Using Oracle APEX v4.2 on 11g, I have the following scenario and wanted to take other people on how to accomplish what I'm trying to do, i.e.:

    In region 1, I have a select item list page called P1_SELECTION, which contains selections from drop down to the user to choose from the following three: A1, B2 and C3

    In region 2, I have two checkbox elements:

    P1_CBOX1 I gave a conditional display of ' point value / Expression 1 column! = 2 expression, where Expression 1 = P1_SELECTION and Expression 2 = B2, so P1_SELECTION! = B2

    P1_CBOX2 I gave a conditional display of ' value of the point / column Expression 1 = Expression 2 where Expression 1 = P1_SELECTION and Expression 2 = B2, then P1_SELECTION = B2 .

    Use of dynamic Action on the evolution of the P1_SELECTION in region 1, how can I trigger the correct display of the checkbox in region 2, with the default view of the region 2 checkbox being P1_CBOX1, without submitting the entire page, just refreshing each of the elements checkbox to trigger the conditional display correct?

    For example, on the changes of P1_SELECTION = B2 then entire submission without page, only P1_CBOX2 is presented to the user in other P1_CBOX1 is displayed.

    Is this possible?

    Thank you.

    Tony.

    Hi Tony,.

    condition your dynamic action on P1_SELECTION with the following condition of javascript: this.triggeringElement.value = "B2".

    Add real actions that will show P1_CBOX2 and hide P1_CBOX1

    Add false actions and going hide P1_CBOX2 show P1_CBOX1

    Set the dynamic actions to fire on Page load

    Kind regards

    Erik-jan

  • Call a process report link Page

    Hello.

    I use Apex 4.2.1 on mod_plsql and Oracle 11 g 3.

    I'm trying to run a PLSQL after - submit process page when users click on a link generated SQL in a classic type report.

    For example, my classic report uses the query:

    SELECT

    E.*,

    ' < an id = "RID" href = "f? p = & APP_ID.:31: & SESSION. : ADDROW:P31_ENAME, P31_MGR, P31_DEPTNO:'

    || E.ENAME

    || ','

    || TO_CHAR (E.MGR)

    || ','

    || TO_CHAR (E.DEPTNO)

    || « « > »

    || 'Add new line '.

    || '< /a >' AS ADD_ROW

    Of

    EMP E

    My page has also a submit after PLSQL method defined as:

    declare

    whole v_empno;

    Start

    Select nvl (max (empno), 0) + 1

    in v_empno

    EMP;

    Insert into emp (empno,

    Ename,

    Bishop.

    DEPTNO)

    values (v_empno,

    substr(:P31_ENAME,1,1) | '-' || TO_CHAR (v_empno),

    TO_NUMBER(:P31_MGR),

    TO_NUMBER (:P31_DEPTNO));

    end;

    This process is the condition 'Request = Expression 1', where 'Expression 1 ="ADDROW.

    I thought that if users click on the report link "ADD_ROW", then items ENAME, MGR and DEPTNO report would be sent to corresponding page elements.  In addition, the PLSQL process above would be carried out and add a new line to the EMP table.  The report would then display then the newly added row.

    But when I click on the link for the report, I see that my page elements, in fact, the report associated a value assigned.  But the process page is never executed.

    I looked at the page state in Session and in debug mode.  The transformation runs simply never my page process.

    Anyone knows why my page process is not executed?  And how do I get the page process runs when users click on the report link?  Indeed, what is the point of having even a floor embedded in the url, so REQUEST it is not recognized bt other processes on the page?

    In my workspace from apex.oracle.com, I created an example page where all this was coded:

    Workspace: EEG

    User name: [email protected]

    Password: galaxy123 (all lowercase)

    AppID: 27083 (Elie_Goodies)

    Page 31 (Option to request Url of Test)

    I would appreciate if someone could help me with what I am puzzled why it doesn't work.

    Thank you very much.

    Elijah

    Hi Elijah,

    I think it's fixed.  It was very close. It's just a matter of timing.

    For a REQUEST be visible after do you need to submit the page.  Something like apex.submit ("ADD_ROW") will do it.

    Then, when the page displays the QUERY is empty again.

    Same thing with the link, which is what you have implemented, the DEMAND is there for the rendering of the page. Then he disappeared when the page is sent.

    All I had to do is move your process to run before header so that it can 'see' the value of the claim.  I have not touch (or seek) and the code.

    Points of treatment area or on a charge before the header or before loading would have worked here.

    Thank you

    -Jorge

    Post edited by: jrimblas

  • INSERT BUSINESS

    Hello



    I want to execute insert statemnt that is where expression is possible.

    IAM having the qury like this:

    Select case when LENGTH (REGEXP_REPLACE ('iuewuiweui', ' [^ t]')) > 3 then
    ((insert into values xx (1,1,1,1,1))) any other purpose XX;


    Help out me

    Thank you

    Yes it gives Cartesian product and also you saidTN1 table a number of records. So you may be required to use a join or else condition in your case.

    Ravi Kumar

  • How update the form element in IR with value when it is null when you press Go?

    Hello

    in an international registration, I created a Date picker component. I want this element when the user enters the page to have a default value. I would also like when the user clears this area the corresponding item to get a default value. I realized the 1 but not the 2nd. I need this replacement to the value of the element because he his need in one between day where expression in the report query and I want to have the bind variable only, not NVL them in order to avoid to analyze all the partitions table. Thi point is used as an additional lookup field in the report and it is included in the elements of the Page to submit. Advanced report attributes.
    How can I do this?

    What I put up the atm:

    The source used
    Still, replacing value that exists in session state

    Type of source
    PL/SQL Expression or a PL/SQL function

    Source of value or expression
    TRUNC (SYSDATE)

    and also in default:

    Default value
    RETURN TO_DATE('01/01/1980','DD/MM/RRRR')

    Default value type
    Body of the PL/SQL function

    TIA

    Mrs..,

    Try this, sorry I did not test it ;)

    onblur="if (!this.value){this.value = $v('PX_HIDDEN_DATE_ITEM')}"
    

    Kind regards
    Dan

    http://danielmcghan.us
    http://www.skillbuilders.com

    You can reward this answer by marking as being useful or correct ;-)

  • Hide and see the question.

    I asked with button I need to show when the status is "draft".

    I created a condition created for the button where Exoression 1 value = Expression 2

    Where expression 1 is P9_X_STATUS

    and expression 2 is the project.

    The button is still hidden.

    Just to let you know that if I place the button under status field, my skin and see the condition works.

    Any idea?

    Robert

    Hi Robert,.

    Replace the last part of your predicate of...: P9_X_STATUS = null for:...: P9_X_STATUS IS NULL

    Martin

    -----
    [http://apex-smb.blogspot.com/]

  • Where can I get disk download Express Media Player Boot?

    Only I have reformat my hard drive on my M55 S3291, when I bought this M55 it does not come with the Express Media Player Boot disk since I didn't buy no official distributor. is there a way where I can download/limewire or a copy of it. Thank you.

    The media Express with that Player was delivered selected laptops.
    I don't know if the EMP has been delivered with this laptop because it seems that it is an American unit.
    However, the fact is that you can't download the Express Media Player from the website. It is perhaps possible to get this program to the Toshiba service partner.

  • Once I connect the base station through ethernet express to extend my network, I do then disconnect it and move it where I need strength signal more?

    I need to extend my Airport extreme signal upstairs to dead zones.  I bought an Airport Express and it connected via ethernet and implemented.  Now that it's set up, I unplug the ethernet cable and take the extreme in an area on the floor where I have a problem?

    No, it's now the wrong configuration.

    Back at the factory. Power off... Hold Reset... Turn on again and the keep held in reset for 10 seconds.

    Redo the express installation... it will automatically extend wireless placing him in the same room as the extreme with power on... No ethernet.

    Once it's Setup move the Express where it better covers the floor... it won't be on the floor... the express should get good signal... is the worst place to put L'Express is right next to the device is bad signal... because guess what... the express can is no better. At halfway, not midway distance but to halfway in terms of wireless signal...

    Often difficult to find such a place if your level is the concrete floor... running can help some adapters homeplug ethernet or use around obstacles.

  • Try to transfer mail from outlook express to windows live but my display windows live doesn't have a tab "file" on the banner. Where is he?

    Try to transfer mail from outlook express to windows live but my display windows live doesn't have a tab "file" on the banner.  Where is he?  I even downloaded the latest version of Windows Live Essentials and didn't get any results in obtaining the 'file' tab is displayed when you click in the upper left corner or in the Live window.  It appars I may be trying to work with a version under Windows Live but can't seem to get the "good".

    There is no bar in WLMail 2011 and 2012. What version do you use? The last version to work under XP (this forum) is WLMail 2009 and having a Menu bar with file on it.
     
    If you transfer to a more recent machine...
     
     
     
    In Outlook Express, compact you files first.
     

    Click Outlook Express at the top of the the folder tree so no folders are open. Then: File | Work offline (or double-click on work online in the status bar). File | Folder | Compact all folders. Don't touch anything until the compacting is completed.
     
     
     
     
    Transfer of data from Outlook Express and Windows Live Mail:
     

    For Messages:
     

    Copy the * ENTIRE * OE message store folder to a flash drive. (Folders.dbx must be included). Place it on the desktop or another location on the computer using WLMail.
     
    V-2009: open WLMail and: file | Import | Messages | Microsoft Outlook Express 6, and the point where it was saved.
     

    V-2011/2012: Menu button. Import Messages. Microsoft Outlook Express 6, and the point where it was saved.
     

    Location of OE message store:
     

    In OE: Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.
     

    In Windows XP the OE User (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder Options icon | Opinion, or in Windows Explorer. Tools | Folder options | View.
     

    Note: If any DBX file is over 300 MB, return to OE and move some messages from the folder related to a new user created folder and compact down the size of the file.
     

    For addresses:
     

    Open the address book in OE and file | Export | Address book (wab) and save it to the desktop. Copy it to a flash drive. Place it on the desktop or another location on the computer using WLMail.
     
    For WLMail 2009: Open list of Contacts in WLMail, (go |) Contacts in the Menu bar) and the file | Import | Address book (wab) Windows and the point where you saved it.
     
    WLMail 2011/2012: switch to the contacts window (click on the book icon to the address at the foot of the folders pane, or press Ctrl-3). Click on the import button, select address book (wab) Windows and point on where it was saved.
     

    Note: If you use a CD or a DVD instead of a flash drive, after placing on the new machine you must remove the read-only attribute in the properties before you import.
     

    For the account settings:
     

    In OE: Tools | Accounts, select the account and export it to the desktop. This will be an .iaf file. Copy it to the new desktop computer.
     
    For WLMail 2009: Tools | Accounts and import the settings from the location you saved the.
     
    For WLMail 2011: The Menu button. Options | E-mail accounts and import the settings from the location you saved the.
     

    Account settings do not matter in WLMail 2012. You will have to do it manually.
     

    Windows Live Mail help is in this forum

    http://answers.Microsoft.com/en-us/windowslive/Forum/LIVEmail?tab=all 
     
     
     

     
     

     
     
  • Outlook Express 6, if I accidentally put a block on all mail entering .aol accts where can I find tools for restore it?

    If I accidentally put a block on all mail entering .aol accts where can I find tools for restore it?

    Hello


    I suggest to read the following steps and check if it helps.

    a. open Outlook Express
    b. Select tools, then select Message rules, click on the list of senders blocked in Outlook Express menu.
    c. highlight the sender or domain that you want to remove.
    d. click on delete.
  • Where can I find the Outlook Express Mail Server name Info

    original title; Outlook Express Mail Server name Info

    How to check or enter the name of the server for Outlook Express? I get an error message indicating that I entered the server name correctly but I don't know how to correct it. My mail will never be out fo. I have photos I am trying to send to Snapfish and they will not download.

    I've never used Snapfish, but I don't see where this has nothing to do with Outlook Express, an e-mail client. While glancing at their website, it seems that you download photos from your computer as you would to Photobucket or SkyDrive, you do not send by e-mail their. You should not need to use any e-mail program to achieve this.
     
     
     
    If for any reason you wish to configure OE to e-mail, you need get the correct account settings of your mail server and then follow the instructions here.
     
    Setting up email in Outlook Express servers:
    http://www.Microsoft.com/Windows/IE/community/columns/mailserver.mspx 
     
     
     
  • where can I find answers / help for Microsoft Outlook Express 6. A batch of 4 months of emails hepatitis has disappeared from my file SENT. THX

    Cannot find where to look for help on Outlook Express (OE 6). ???  A lot of emails suddenly disappeared from my file of SENT MESSAGES, and I need them.

    Help of OE is at: XP Networking & Online , but I can help.
    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-networking?page=1&tab=all
     
    View | Current view. Show all Messages is verified? If this is the case, then you have to do.
     
     
    Two reasons the most common for what you describe is disruption of the compacting process, (never touch anything until it's finished), or bloated folders. More about that below.
     
    Why OE insists on compacting folders when I close it? :
    http://www.insideoe.com/FAQs/why.htm#compact
     
    Why mail disappears:
    http://www.insideoe.com/problems/bugs.htm#mailgone
     
    Recovery methods:
     
    If you are running XP/SP3, then you should have a backup of your dbx files in the Recycle Bin (or possibly the message store), copied as bak files.
     
    To restore a folder bak on the message store folder, first find the location of the message store.
     
    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.
     
    In Windows XP, the .dbx files are by default marked as hidden. To view these files in the Solution Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder options | View.
     
    Close OE and in Windows Explorer, click on the dbx to the file missing or empty file, then drag it to the desktop. It can be deleted later once you have successfully restored the bak file. Minimize the message store.
     
    Open OE and, if the folder is missing, create a folder with the * exact * same name as the bak file you want to restore but without the .bak. For example: If the file is Saved.bak, the new folder should be named saved. Open the new folder, and then close OE. If the folder is there, but just empty, continue to the next step.
     
    First of all, check if there is a bak file already in the message. If there is, and you have removed the dbx file, go ahead and rename it in dbx.
     
    If it is not already in the message, open the trash and do a right-click on the file bak for the folder in question and click on restore. Open the message store up and replace the .bak by .dbx file extension. Close the message store and open OE. Messages must be in the folder.
     
    If messages are restored successfully, you can go ahead and delete the old dbx file that you moved to the desktop.
     
    If you have not then bak copies of your dbx files in the Recycle Bin:
     
    DBXpress run in extract disc Mode is the best chance to recover messages:
    http://www.oehelp.com/DBXpress/default.aspx
     
    And see:

    http://www.oehelp.com/OETips.aspx#4
     
     
     
    A general warning to help avoid this in the future:
     
    Do not archive mail in default OE folders. They finally are damaged. Create your own folders defined by the user for mail storage and move your mail to them. Empty the deleted items folder regularly. Keep user created folders under 300 MB, and also empty as is possible to default folders.
     
    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the CPUs, slows down sending and receiving and causes a multitude of problems such as time-outs, account setting changes and has even been responsible for the loss of messages. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:

    http://www.oehelp.com/OETips.aspx#3 
     
    And backup often.
     
    Outlook Express Quick Backup (OEQB Freeware)
    http://www.oehelp.com/OEBackup/default.aspx  

Maybe you are looking for