How to retrieve a single value to an XMLTYPE

Hello

I have the following XML is stored in an XMLType column.

< root >
< abc > 1 < / abc >
< abc > 2 < / abc >
< root >

How can I extract the first occurrence of/root/abc?

Thank you and best regards,
A

A number like predicate will give you the nth occurrence.

Select extractValue (XML_CLOB, ' / root/abc [1]')
everything which

Chris

Tags: Database

Similar Questions

  • Retrieve a single value from a file .lvm

    I have a large batch of files of worksheet whose name is a timestamp. I am writing a program that will get the value of a specific cell (the same cell in each file), coupled with the timestamp and each of them as a pair of coordinates, then save in a master spreadsheet. The goal is to extract a point each of the 700 files I and compile them into a single file.

    However, I've never used Labview to read the files before. I saw some stuff on how to read an entire worksheet in a table, but I was wondering if there was a way to say to Labview to look into a file and extract a single value. I open .lvm in Excel files, so, in my mind, I would be taking, for example, cell D2. Is this feasible? Should I read the entire worksheet in an array and use the index to pick it up on the table? If I do, how I would specify cell J2 as an array index (I have no experience with the berries in Labview either). In addition, if you have any tips on how to record easily 700 pairs of coordinates, that came together in the order, to a single spreadsheet, that is my next task.

    Essentially- I need to extract a single value of a spreadsheet in, ideally, the simplest possible. In addition, pointers on how to save the numbers gathered at each iteration of a while loop to a single worksheet are welcome.

    Thanks in advance for the help!

    FYI I have LabView v8.6

    You can't say LabVIEW to 'out' a specific 'cell' more you can tell Notepad to do. the .lvm files are just text files. When you open them in Excel, the column separator (default tabs) show to put the values in columns. In LabVIEW measurement file VI reading to read .lvm files. It creates the dynamic data, wrong data type that is next to useless. You will need to convert this type of data in a table by using the function convert of DDT. Or, you can use the VI read spreadsheet file. This will give you a table directly. You can just remove the specific item using the table to Index.

  • How to write a single value in an excel spreadsheet

    Hello

    I use an excel spreadsheet, as if it were an external code module. He does a lot of calculations, all I do is write an individual value, let calculate what it should only then read a return value from this.

    I already have a structure able to read a table, but could someone help me with a piece of code that could write a single value?

    (To read a value unique too may be practical)

    Also, I have the new LabVIEW 2009, so while a fancy to drop some code here as one. PNG, it would be nice to see if this new feature works!

    Thank you, Alec

    Try this. There are 2 point methos (get) and point (put) to read and write the value respectively to a cell in excel.

    Good luck

  • How to retrieve the actual value of this utl_raw.cast_to_raw () function

    I created a table like...

    create table mytable (name of user varchar2 (100));

    and added a column as...

    ALTER table mytable add raw (16) password.

    After that I'm inserting a value using below function,

    insert into mytable (username, password) values (: UN, utl_raw.cast_to_raw (:pwd)))

    United Nations-> abc
    pwd-> abc
    now, I want to display the data in the table,
    Select * from myTable. It is showing like this
    username password
    ABC 616263

    I want to see the real value of the password-> abc
    How to recover the actual value...
    Any help to solve the problem

    Published by: Guy on March 21, 2012 23:25

    On my 11.2.0.1 test the db instance:

    scott@ORCL> create table mytable(username varchar2(100));
    
    Table created.
    
    scott@ORCL> alter table mytable add password raw(16);
    
    Table altered.
    
    scott@ORCL> var un varchar2(10);
    scott@ORCL> var pwd varchar2(10);
    scott@ORCL> exec :un:='test';
    
    PL/SQL procedure successfully completed.
    
    scott@ORCL> exec :pwd:='testpw';
    
    PL/SQL procedure successfully completed.
    
    scott@ORCL> insert into mytable (username, password) values (:un , utl_raw.cast_to_raw(:pwd));
    
    1 row created.
    
    scott@ORCL> select * from mytable;
    
    USERNAME                                                                                             PASSWORD
    ---------------------------------------------------------------------------------------------------- -------------------------
    test                                                                                                 746573747077
    
    1 row selected.
    
    scott@ORCL> column pw for a15;
    scott@ORCL> select username,utl_raw.cast_to_varchar2(password) pw from mytable;
    
    USERNAME                                                                                             PW
    ---------------------------------------------------------------------------------------------------- ---------------
    test                                                                                                 testpw
    
    1 row selected.
    

    Concerning
    Girish Sharma

  • How to retrieve the selected values of the selectOrderShuttle using ADF 11 g

    Hello world

    Did anyone has idea how to retrieve the selected items by using the shuttle and the order of the elements by using the 'SelectOrderShuttle '?

    Thank you

    valuechangeevent of the shuttle would fire when you shuttle points back.

        public void selectOrderShuttle1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
    
            ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
    
            if (list != null){
                for (int i=0; i
    
  • How to retrieve a single record from access by program?

    I need to recover a single access record. I have two columns, 'Sess' and 'Topic' in my database. I want back the Session number ('Sess') for a particular topic and post it on the front panel. I wrote the attached VI based on an example I found. This VI contains the number of the Session for the first record, but I can't understand how to identify a search for a specific record in the table.  Thank you!

    Do a google search for «sql tutorial» You need to learn how the SELECT statement. The general syntax is:

    SELECT column_name (s)
    Table_name FROM
    WHERE column_name operator value

  • How to retrieve the XML values in a plsql table type

    Hello

    I have an XML doc as below which is a Web Service response message.

    <? XML version = "1.0" encoding = "UTF-8"? >
    < SOAP - ENV:Envelope
    xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/".
    container = "http://www.w3.org/2001/XMLSchema".
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" >
    < SOAP - ENV:Body >
    < GetOrgInput xmlns = "http://www.example.org/ComplianceServices" >
    < ProgramName > PgmA-Srsf < / ProgramName >
    < > 800 ADSL ItemName < / ItemName >
    < org > 923 < / org >
    < org > 1163 < / org >
    < org > 1103 < / org >
    < / GetOrgInput >
    < / SOAP - ENV:Body >
    < / SOAP - ENV:Envelope >

    The doc above, you could see that I have several occurrences of the element "Ent". I usually use the .extract and. getSTringVal() to retrieve the values as below.

    l_string_variable: = p_response.doc.extract ('/ /'| p_name |) ' /Child::Text()',p_namespace).getStringVal();

    But in this case if I do that, I get value as 92311631103. I need to get them in a table of the number type. Pls advice me on how to do this.

    Thank you
    PKV

    I'm guessing it's a bug fixed when Oracle 10.2 is released. I can reproduce your lack of results on 10.1.0.4 and as shown in my post above, it works correctly on 10.2.0.4.

    Here is a modification of the script that shows what is happening that I have that debugging. (It took me a bit to realize the difference that it wasn't what I was expecting)

    declare
       p_response_doc XMLTYPE;
       l_new_doc      XMLTYPE;
    begin
       p_response_doc := XMLTYPE('
    
    
    
    1163
    1103
    
    
    ');
       SELECT p_response_doc.extract('/*/*/*/CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
         INTO l_new_doc
          FROM dual;
       dbms_output.put_line(l_new_doc.getStringVal());
       dbms_output.put_line('before loop');
       FOR r_rec IN (SELECT value(t) val
    --   FOR r_rec IN (SELECT extractvalue(value(t)
    --      , '/CompliantOrgs'
    --      , 'xmlns="http://www.example.org/ComplianceServices"' ) val
          -- BULK COLLECT INTO l_nm_array
          FROM TABLE(
            XMLSequence(
              p_response_doc.extract('/*/*/*/CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
              )
            ) t
       ) LOOP
          dbms_output.put_line(r_rec.val.getStringVal());
    --      dbms_output.put_line(r_rec.val);
       END LOOP;
       dbms_output.put_line('After output');
    end;
    

    10.2.0.4 on this product

    1163
    1103
    
    before loop
    1163
    1103
    After output
    

    It produces on 10.1.0.4

    1163
    1103
    
    before loop
    1163
    
    1103
    
    After output
    

    As you can see, Oracle is to detach (well technically not add) the space of default names to the nodes retrieved. To compensate, you need to change your loop to look like

       FOR r_rec IN (SELECT extractvalue(value(t)
          , '/CompliantOrgs') val
    --      , 'xmlns="http://www.example.org/ComplianceServices"' ) val
          -- BULK COLLECT INTO l_nm_array
          FROM TABLE(
            XMLSequence(
              p_response_doc.extract('//CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
              )
            ) t
       ) LOOP
    

    so extractValue does not expect the namespaces associated with the nodes.

    I would suggest you document it so that you know why things break if you upgrade to 10.2 or later at some point in the future.

  • Best practices for retrieving a single value from the Oracle Table

    I'm using Oracle Database 11 g Release 11.2.0.3.0.

    I would like to know the best practice to do something like that in a PL/SQL block:

    DECLARE
        v_student_id    student.student_id%TYPE;
    BEGIN
        SELECT  student_id
        INTO    v_student_id
        FROM    student
        WHERE   last_name = 'Smith'
        AND     ROWNUM = 1;
    END;

    Of course, the problem here is that when there is no success, the NO_DATA_FOUND exception is thrown, which interrupts the execution.  So, what happens if I want to continue despite the exception?

    Yes, I could create a block nested with EXCEPTION section, etc, but it seems awkward for what seems to be a very simple task.

    I've also seen this handled like this:

    DECLARE
        v_student_id    student.student_id%TYPE;
        CURSOR c_student_id IS
            SELECT  student_id
            FROM    student
            WHERE   last_name = 'Smith'
            AND     ROWNUM = 1;
    BEGIN
        OPEN c_student_id;
        FETCH c_student_id INTO v_student_id;
        IF c_student_id%NOTFOUND THEN
            DBMS_OUTPUT.PUT_LINE('not found');
        ELSE
            (do stuff)
        END IF;
        CLOSE c_student_id;   
    END;

    But it still seems to kill an Ant with a hammer.

    What is the best way?

    Thanks for any help you can give.

    Wayne

    201cbc0d-57b2-483a-89f5-cd8043d0c04b wrote:

    What happens if I want to continue despite the exception?

    It depends on what you want to do.

    You expect only 0 or 1 rank. SELECT INTO waiting for exactly 1 row. In this case, SELECT INTO may not be the best solution.

    What exactly do you do if you return 0 rows?

    If you want to set a variable with a NULL value and continue the treatment, Frank's response looks good, or else use the modular Billy approach.

    If you want to "do things" when you get a line and 'status quo' when you don't get a line, then you can consider a loop FOR:

    declare
      l_empno scott.emp.empno%type := 7789;
      l_ename scott.emp.ename%type;
    begin
      for rec in (
        select ename from scott.emp
        where empno = l_empno
        and rownum = 1
      ) loop
    l_ename := rec.ename;
        dbms_output.put_line('<' || l_ename || '>');
      end loop;
    end;
    /
    

    Note that when no line is found, there is no output at all.

    Post edited by: StewAshton - Oops! I forgot to put the result in l_ename...

  • Impossible to retrieve the return value of function from pl/sql using the DB adapter

    Dear Experts,

    I use the DB adapter in my BPEL process. Using the DB adapter I invoke a PL / SQL function. I am able to send two input parameters for the pl/sql function. But I do not know how to retrieve the return value of the function. Please suggest me.

    Thank you
    Rajesh

    Can you tell how pl/sql function looks like you? you return the value of the function, right?

  • How can I retrieve all the values in a single query in the oracle XML

    Hi all

    I have xml format below, how do I retrieve all the values in a single query.

    < files >

    < job > MANAGER < / job >

    < details >

    < ename > JONES < / ename >

    < sal > 2975 < / sal >

    < ename > BLAKE < / ename >

    < sal > 2850 < / sal >

    < ename > CLARK < / ename >

    < sal > 2450 < / sal >

    < / details >

    < / documents >

    Thank you

    I prefer desgin a little more sophisticated xml and wrap the details in a separate label.

    Then you could something like that

    1 with testdata until)
    2. Select xmltype)
    3'
    4 MANAGER
    5


    6
    7 JONES
    8 2975
    9

    10
    11 BLAKE
    12 2850
    13

    14
    15 CLARK
    16 2450
    17

    18

    19
    20 ') in the form x
    21 double
    22)
    23 select
    24 j.job
    25, d.ename
    26, d.sal
    27 of testdata
    28 join
    29 xmltable ("Scriptures" in passing testdata.x)
    30 columns
    31 job varchar2 (30) path "job."
    32, details xmltype path «details»
    (33) j
    34 (1 = 1)
    left outer join 35
    36 xmltable (' details/emp' in passing j.details)
    37 columns
    path of varchar2 (30) 38 'ename' ename
    39, path of varchar2 (30) sal "sal".
    (40) d
    41 * (1 = 1)
    >/

    JOB                            ENAME                          SAL
    ------------------------------ ------------------------------ ----------
    JONES MANAGER 2975
    BLAKE MANAGER 2850
    MANAGER CLARK 2450

  • How to retrieve the values of character without using single quotes

    Hi all

    How to retrieve the values of character without the use of single quotes. Its Possible in Oracle SQL

    Please answer me...

    For example

    Is actual query-> Select * from employees where name like in("SCOTT", "JAMES", "ALBERT",...);

    I want to--> Select * from employees where name like(SCOTT, JAMES, ALBERT...); -without the use of single quotes.

    Why I need this application, I need to retrieve the records more than 200 employees in a select statement by using name in where clause.

    shagarmahabubjan wrote:

    Hi all

    How to retrieve the values of character without the use of single quotes. Its Possible in Oracle SQL

    Please answer me...

    For example

    Actual query is---> Select * from employees where name like in("SCOTT", "JAMES", "ALBERT",...);

    I want to---> Select * from employees where name like(SCOTT, JAMES, ALBERT...); -without the use of single quotes.

    Why I need this application, I need to retrieve the records more than 200 employees in a select statement by using name in where clause.

    In short... you can't.  The channels are channels, and SQL and PL languages dictate that the string literals are provided within single quotes.

    I don't see how trying to retrieve more than 200 records of employees in the select statement means that you must get rid of the quotes.

    Be clear in what you ask: Re: 2. How can I ask a question on the forums?

    and take note of the FAQ link davidp provided the solution "variable IN the list.

  • How to retrieve a value of page element in another page?

    Hello

    How to retrieve a value of page element in another page?

    say P55_COURSES_TO_EVALUATE is my name of the page element, and it is a selection list. Based on the value selected in the next page I see the details of the selected value shd and for that I need P55_COURSES_TO_EVALUATE value in the following page. How to do it? When I try to retrieve the values it simply returns nothing.
    Pointers would be really useful.

    Thanks in advance.

    Hello

    Could you please how you try to use it?

    If you set the value to the P55_COURSES_TO_EVALUATE element and submit the page, the value is stored in session state.
    Then you can use this element in any page as

    :P55_COURSES_TO_EVALUATE
    

    You cannot access page value in javascript/jQuery to other pages like

    $v('P55_COURSES_TO_EVALUATE')
    document.getElementbyID('P55_COURSES_TO_EVALUATE')
    $(#P55_COURSES_TO_EVALUATE)
    

    Because the item is not on the other pages. In javascript from other pages, you can use

    var a = '&P55_COURSES_TO_EVALUATE.';
    

    Kind regards
    Jari

  • How to retrieve a value of IT policy rule?

    Hello

    Does anyone have information/documentation on how to recover a political value of a handheld COMPUTER? We develop a blackberry application that needs to parse a value to a custom COMPUTER thrust on a device policy rule.

    Thank you

    BBJim

    http://www.BlackBerry.com/developers/docs/4.6.0api/NET/rim/device/API/itpolicy/ITPolicy.html

    Basically just ITPolicy.getString (key) or .getBoolean, getInteger, etc., when the key is the name of the key to the strategy.

    Andrea

  • How to set the initial value for a single radiobutton in a group of Radio buttons

    Hi all

    I have a radiogroup with 3 buttons. The names of the RadioGroup are driven out of a XXVO.

    3 Radion buttons:

    + 9
    * XX
    * XXX

    When loading the Page I want to make an XXX option button to be the default, please suggest how.

    Note: The radiobutton values come from VO

    Thank you

    Hello

    XXCONTACT_ADDR_BUTTON1 - is the value of the radio button to select the right...

    Very well.. :))

    Concerning
    Meher Irk

  • Lost admin password, how to retrieve the current password to change it?

    I forgot my Admin password, I connect on my laptop using the scanner print finger all the time and when I try to change the password for Admin it ask the password which I do not remember. How to retrieve the current password and change it in Windows 7 Home premium?

    It's a laptop Acer 5738 G

    You can change your current password as follows:

    1. click on start.
    2. type the three letters cmd in the search box.
    3. press on Ctrl + Shift + Enter
    4. click on "run as Administrator".
    5. type the following command and press ENTER after each:
    NET user "user %%nom" 123456

    Now the password is 123456. While dealing with accounts and passwords: having a single admin account on a PC is about the same as having a unique key for your car. What happens if you lose? He lost? Break it? A robust Windows Setup requires at least the following:

    • Two admin accounts fully tested, with their passwords to record on paper.
    • A password key file. Click Start / Help, then search for help on "password". Follow the instructions to create a key on your USB flash drive file so that you'll never find yourself in this uncomfortable situation.

Maybe you are looking for