How to extract the values of XMLTYPE column,

SQL > create table temporary global xmtype_tab (xmlfile xmltype);

SQL > select * from all_directories;

SYS RESTOREDIR/home / / dbimptask /.

insert into xmtype_tab values (xmltype (dbms_xslprocessor.read2clob ('RESTOREDIR ','LAS_SETUP.xml ')));

1 line of creation.

SQL > select * from xmtype_tab;

XMLFILE
--------------------------------------------------------------------------------
<? XML version = "1.0"? >
rowset <>
< ROW >
< DATA_CAPTURE_ON > 1 < / DATA_CAPTURE_ON >


How to extract the values inside each tag?


XML file has the following data...


rowset <>
< ROW >
< DATA_CAPTURE_ON > 1 < / DATA_CAPTURE_ON >
< > 9600 BAUD_RATE < / BAUD_RATE >
< ACK_TIMEOUT > 1 < / ACK_TIMEOUT >
< TUBE_TRAVEL_LIMIT > 4 < / TUBE_TRAVEL_LIMIT >
< SEND_SID_TIMEOUT > 1 < / SEND_SID_TIMEOUT >
< INDEX_Q_TIMEOUT > 2 < / INDEX_Q_TIMEOUT >
< HW_HANDSHAKING > 1 < / HW_HANDSHAKING >
< / ROW >
< / LINES > ';

I use the Oracle 10.2.0.3 version...

Why does this work?

You are missing the tag of the ROWSET:

select extractvalue (xmlfile, '/ROWSET/ROW/BAUD_RATE') baud_rate
  from xmltype_tab
 where existsnode (xmlfile, '/ROWSET/ROW/BAUD_RATE') = 1;

Tags: Database

Similar Questions

  • How to get the value of a column in sql query?

    Hi, anyone knows how to get the value of a column in sql query?

    Here is my code, the value must be 1350079224397 in my PB, but I get 0

    QString query ("SELECT version FROM db_version");

    QVariant result = sda.execute (query);
    QVariantMap versionMap = result.toList () such () .toMap ();
    If (! versionMap.IsEmpty ())
    {
    qDebug()<"Version: "=""><>
    }

    OK, I have the solution

    QString query ("SELECT version as version FROM db_version");

  • How to set the value of a column in a table according to another column?

    Hello world!

    I use Apex 4.1.
    My question is how can I set the value of a column in a table according to another column?
    I have a table and when I insert the value in the column content, I want to change this value in the note column with the note, which is generated with pl/sql function (function of string returned if the typed value is in the range).

    I tried to use javascript as
     $('input[name=f02]').live('change', function(){
    if($(this).val()!='1'){
    $('input[name=f03]').val("test")}
    }); 
    for the development of the column note to test if the value typed in the content of the column is not 1, but this code assigns the value to all the lines and I need to set only the specified line.

    Can someone give me a hint in any way to do this if possible?

    Kind regards
    drama9346

    You will need create a process on your page type PLSQL and develop this process "we demand" of the page. In this process, you can run the PLSQL you need. That is to say to retrieve the note value as described in your PC:

    and when I insert the value in the column content, I want to change this value in the note column with the note, which is generated with pl/sql function (function of string returned if the typed value is in the range).

    In this process, you must provide a return value of the call, and you can do this by using htp.p. Example:

    DECLARE
       --putting x01 in a var to simplify
       l_test_var VARCHAR2(200) := apex_application.g_x01;
       l_return VARCHAR2(200);
    BEGIN
       -- a simplistic test
       IF LENGTH(l_test_var) BETWEEN 10 AND 20 THEN
          l_return := 'String is between 10 and 20';
       END IF;
    
       --this will write l_return to the buffer, and the ajax callback will receive this
       htp.p(l_return);
    END;
    

    And the code that I wrote above, which is javascript, would need to go where your current code is that binds to the onchange event. The result should be that, when a change is made to this element, an ajax request is made on the server. When the call is finished, it will be the value returned in the item you want.

  • How to capture the value of type column report

    It would be a great help that you might suggest the following

    (i) Java script that I wrote on the standard status column (in a tabular report) fails.
    This happens because of the standard status column, if I use the text field then called Javascript function and showing correct results.

    Now, here, I want to know how to capture the value of the column standard report, since javascript fails due to
    the column values of standard report unrecognized.

    Example:

    Columns of the report as a table:
    ```````````````````
    Standard report column: salary
    TextField report column: new treatment
    Report column standards: difference

    I've written the javascript on column New_salary function which returns the value of the salary column to calculate the difference.

    For this column of report types, the javascript function does not work, that is to say, it does not show the difference., since it is not read
    the value of the column Salary (which is the Standard type of report column)
    Once I have change the Salary column to text (display as saved state) javascript field works fine.

    All entries on how to capture the standard value of the column, so that I can access the value of the javascript function.

    Thanks in advance
    Vijay

    Hi Vijay - I had problems with the forum as well (and my workspace OTN so)!

    You have two questions, I think.

    First of all, that the old wage is not an input element, you can not get to it by referring to an ENTRY tag. you will need to change that to something like:

    var s1 = d[k-1].firstChild.nodeValue;
    

    This means that there is nothing else in the cell apart from the text - as in < td > < table > 123. If there is something else there that stops you getting the value using the above, you can go through these nested tags referring to objects further firstChild-

    var s1 = d[k-1].firstChild.firstChild.nodeValue;
    

    As I don't see your page, you need to check yourself to see firstChild how much you need. This example assumes that you had something like: < td > < b > 123 < /b > < table >

    Second, the values of s and s1 are strings. You must convert these numbers to be able to perform calculations. You have two javascript functions to do this: ('string') parseFloat and parseInt ('string'). One contains decimals, the other is not - but know that one is not very accurate (it can change "123.456' in ' 123.455999999995' or something similar - not very good! '").

    So, your calculation should be:

    var diff = parseInt(s) - parseInt(s1);
    

    Andy

  • How to extract the values of column aliases based on different column values?

    Hello gurus,

    I have a table with the following struture-
    "drop table T;
    create table T(Name, Symbol, Amount,dep) as select
    'Anderia', 'AA', 1050000,'HR' from dual union all select
    'Michael', 'ML',150000,'Sales' from DUAL union all select
    'Bill', 'BL', 1050000,'Finance' from dual union all select
    'Nancy', 'NY', 4000,'HR' from DUAL union all select
    'Anderia', 'AA',3000,'HR' from dual union all select
    'Michael', 'ML',1050000,'Sales' from DUAL union all select
    'Bill', 'BL', 1200000,'Finance' from DUAL union all select
    'Anderia', 'AA', 1200000,'HR' from DUAL union all select
    'Vish', 'VH', 1200000,'Marketing' from DUAL;"
    And try to find the values of the column as
    Name, symbol, dep, amount, % Total, Total $Cumm, rank but some additional as-columns

    Amount HR, % HRTotal, $HR Cumm Total,
    Finance amount, FinanceTotal %, $Finance Cumm Total
    Sales amount, a percentage of Total sales, $Sales Cumm Total.
    Amount marketing, MarketingTotal %, $Marketing Cumm Total

    then I use the following query to retrieve the name, the symbol, the dep, amount, % Total, Total $Cumm, rank columns.
    select name
         , decode(grouping(symbol), 0, symbol, 'Total') symbol
         , dep
         , sum(amount) amount
         , sum(per_total) "% Total"
         , decode(grouping(symbol), 0, max(Cum_per_total), null) "% Cumm Total"
         , decode(grouping(symbol), 0, max(rank), null) rank
      from (
              select name
                   , symbol
                , dep
                   , amount
                   , per_total 
                   , sum(per_total) over(order by rk) cum_per_total
                   , rank
                   , rk
                from (     
                        select name
                             , symbol
                    , dep
                             , sum(amount) amount
                             , round((sum(amount)/max(total_amount)) * 100,2) per_total
                             , dense_rank () over (order by sum(amount) desc) as rank
                             , row_number() over(order by sum(amount) desc) as rk
                          from (
                                 select name
                                      , symbol
                                      , amount
                          , dep
                                      , sum(amount) over() total_amount 
                                      , sum(amount) over () 
                                   from t
                               )
                         group 
                            by name, symbol, dep
                    )
            )
      group         
         by grouping sets((name, symbol, dep), ())
      order by rank, max(rk) nulls last
    But I want to extract the following columns so... How can I do?

    Amount HR, % HRTotal, $HR Cumm Total,
    Finance amount, FinanceTotal %, $Finance Cumm Total
    Sales amount, a percentage of Total sales, $Sales Cumm Total.
    Amount marketing, MarketingTotal %, $Marketing Cumm Total


    as I want that all records, then will the dep..do-specific I need to use the case here?
    Thanks for all your time and effort in advance

    If I understand your needs, you need pivot: SQL and PL/SQL FAQ

  • How to extract the values of the line full in the bean to support using the primary key

    Hello

    I have a table that has columns as plant_name, business planner email id and identification of email resident engineer. Here, Plant_name is the primary key.

    Now, I have this plant's name slipped and dropped like selectonechoice (drop) on page jsff. In this user can select any name of 1 plant drop down.

    Right now, I can go get plant in backing bean name, but I can't understand how business plan for extraction and identification of email of the engineer resident in this key primary-plant_name at the bean to support.

    Please let me know if anyone has an idea in this regard.

    JDeveloper version 11.1.1.6.0

    Thanks in advance.

    Sneha

    Sneha211 wrote:

    On the jsff page

    required = "#{bindings." Plant.hints.Mandatory}.

    shortDesc = "#{bindings." Plant.hints.ToolTip}.

    ID = "soc1" unselectedLabel = "- Select -"

    autoSubmit = 'true '.

    Binding = "#{backingBeanScope.backingbean.plantbean}" > "

    ID = "si1" / >

    In backing bean

    DCBindingContainer = lBindingContainer

    (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    DCIteratorBinding lBinding = lBindingContainer.findIteratorBinding("SupplierVO1Iterator");

    NewRow row = lBinding.getCurrentRow ();

    String aamplant1 = (String) newRow.getAttribute ("Plant");

    Hi Sneha, you've written code for it

    you have found the current line and the primary key then this line, then why you not not using this same rank to get the other attributes?

    NewRow row = lBinding.getCurrentRow ();

    String aamplant1 = (String) newRow.getAttribute ("Plant");

    String businessPalnner = (String) newRow.getAttribute ("business_planner"); Returns the value of the same line

    Engineer in String = (String) newRow.getAttribute ("engineer");


    OR if your condition is like that-

    you have a primary key field value, but you do not have the corresponding line, then you can get that line and it's attribute by using the primary key value

    See - http://adfgouravtkiet.blogspot.in/2012/10/filtering-of-data-from-vo.html

    Hope it helps

    -Ashish

  • ID - value in XML format. How to extract the value based on the id?

    Hello

    I have a XML type

    < root >
    < resource >
    < id > 123 / < ID >
    < value > CBA < / value >
    < / resource >
    < resource >
    < id > 456 / < ID >
    def < value > < / value >
    < / resource >
    < / root >

    It is stored in a column of XMLTYPE as a CLOB.

    Now, I want to get a particular value based on one id.

    I tried to use the following syntax

    ([Select case when existsnode(x.XML_CLOB,'/Root/Resource[Id="123"]') = 1
    then extractValue(x.XML_CLOB,'/Root/Resource/Value')

    but "/ Root / / value of resource" can mean either of the 2 values. How to solve this?

    Hello

    If the element 'id' is unique you just specify XPath to the 'value' on the basis of extractvalue (given that you are pregnant of a single node):

    WITH x AS (
     SELECT xmltype(
     '
     123abc
     456def
     '
     ) xml_clob
     FROM dual
    )
    SELECT extractvalue(x.xml_clob, 'root/resource[id="123"]/value')
    FROM x
    WHERE ...
    ;
    
  • How to replace the value of a column in a table based on the value in the second column?

    Hi, I would like to find in a table 2D for values that meet certain criteria (for example, a column< 0.98).=""  based="" on="" which="" rows="" meet="" this="" criteria,="" i="" want="" to="" replace="" the="" values="" in="" a="" different="" column="" of="" the="" array="" (change="" to="" 'nan'="" so="" that="" the="" values="" will="" not="" be="" included="" in="" any="" calculations="" on="" that="" column,="" for="" example="" the="" finding="" the="" mean).=""  i've="" attached="" a="" sample="" .csv="" file.=""  if="" the="" values="" in="" column="" 3="" (index="" 2)="" are="" less="" than="" 0.980="" (or="" some="" other="" user="" defined="" value),="" then="" the="" value="" in="" column="" 2="" (index="" 1)="" should="" be="" replaced="" with="" nan.=""  can="" someone="" help="" out="" with="" this="" search="" and="" replace="">

    Thank you

    Keith

    (using LV 2009 SP1)

    A few quick hits.

    You can merge the two for loops

    You have not need one of the constants 1 and 2 in the index table.  They will solve automatically when you expand on the index picture, once you have wired to 0 in the column index.

    It seems a lot of handling additional table spent unnecessarily.

    See below.  I did not try to duplicate your code to see how it actually works, but I believe that I have attached will give the same result with less steps.

  • How to extract the value of QVariantlist

    Hello

    I was trying to understand quoteapp example to implement the sqldata in my application. In this example, they are passing all qvariantlist in groupdatamodel and use it in listview. But I don't want to use listview and want to access the value of a particular column in a table on a page. Anyone can guide me please how?

    I'll try to explain what I did to understand how it works. If you have QVarint or QVariantList, right? So now, print it in console with qDebug().

    You will see something like this.

    QVariant(QVariantMap, QMap(("StationButton", QVariant(QString, "") ) ( "StationButtonSelected" ,  QVariant(QString, "") ) ( "StationIcon" ,  QVariant(QString, "0332.jpg") ) ( "StationName" ,  QVariant(QString, "JD Inside") ) ( "StationStreamURL" ,  QVariant(QVariantMap, QMap((".data", QVariant(QString, "http://www.panel-streaming.com/tunein.php/jdinside/playlist.pls") ) ( "type" ,  QVariant(QString, "pls") ) )  ) ) ( "StationURL" ,  QVariant(QString, "http://www.jdinside.com/") ) )  )
    

    So now if I would get Station stream URL type I need to do the following

    QString currType = data.valueQVariantMap>.value("__StationStreamURL__").value ()QVariantMap> ()QString.value("t__ype__").value > ();

    As you can see the first structure is QVariantMap, so we use data.velue() to get it. Then is StationStreamUrl, as QVariantMap and we can get type and convert it to QString. It's something like cabbage, where you need to remove all the layers.

    It will be useful. If not give me what structure you have and I'll try to help you.

    Thank you.

  • How to extract the values inside the jquery element dialogue modal rigion

    Hi all

    My requeriment is

    Click report link open jquey editable modal dialog and display all values with respective ID values.

    1.I used page header HTML code below

    < link rel = "stylesheet" href = " " http://AJAX.googleapis.com/AJAX/libs/jQueryUI/1.7.2/themes/

    "Redmond/jquery - ui.css" type = "text/css" / >

    " < script src =" http://AJAX.googleapis.com/AJAX/libs/jQuery/1.4.2/jQuery.js "> < / script > .

    " < script src =" http://AJAX.googleapis.com/AJAX/libs/jQueryUI/1.7.2/jQuery-UI.js "> < / script > .

    < script type = "text/javascript" >

    $(function() {})

    () $('#ModalForm').dialog

    {

    modal: true,

    autoOpen: false,

    Width: 600

    buttons: {}

    Back: function() {}

    closeForm();

    } ,

    Approve: function() {}

    addPerson();

    },

    Return_For_Correction: function() {}

    addPerson();

    },

    Reject: function() {}

    addPerson();

    }

    }

    });

    });

    function openForm (TrxId)

    {

    Alert (TrxId);

    $s ('P3_x_trx_id', TrxId);

    $('#ModalForm').dialog ('open');

    }

    function closeForm()

    {

    $('#ModalForm_input[type="text"]').val (»);

    $('#ModalForm').dialog ('close');

    }

    function addPerson()

    {

    var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is updateStatus', 0);

    ajaxRequest.add ('P3_status', $v ('P3_status'));

    var gReturn = ajaxRequest.get ();

    If (gReturn)

    {alert (gReturn)}

    on the other

    {ajaxRequest = null;

    closeForm();

    doSubmit ('SEARCH'); }

    }

    < /script >

    2. static html Id - ModalForm region

    3. region html Header-

    < div id = "ModalForm" title = "View details" style = "display: none" >

    4.footer-

    < / div >

    5. in the same page created 'extraction of line auotomatic' process by using the value of key PK P3_trx_id

    6 Jquery modal region is created but not showing values.

    Hi Dan,.

    You must create a separate page for your modal dialog box,

    Call this dialog in the parent page and pass the value modal page in some hidden item and use the value of the element to retrieve details on the modal dialog box.

    1. change your report Page-> under the header HTML

    
    

    2. change the link from which column you want to call the modal dialog box.

    Target: URL

    URL: javascript:f_modalDetails(#ID#);

    instead ID, pass the value that you want to pass to the modal dialog box that shows you the data associated with the selected line.

    3. go to the page of the form (modal dialog)

    Change your close button that closes the modal dialog box.

    Action: Redirect URL

    Target URL: javascript:window.parent.closeModalDialog();

    Close the Model dialog box using the "submit" button press

    4. create a branch on the processing section of the Page of the page of the modal dialog box

    Branch point: After Processing (After computation, validation and Processing)

    Target type: Page of this Application

    Page: Redirect to the same page

    Request: CLOSE_MODAL

    When you press the button: select the Send button

    NOTE: Branch must be before all the unconditional branch on this page

    5. create a dynamic Action on the Page modal dialog box

    Event: Page load

    Action: Run the JavaScript Code

    Code: javascript:window.parent.closeModalDialog();

    Kind regards

    Jitendra

  • How to pass the value of a column to a variable to be used in another analysis

    Hello

    I'm on OBIEE 11.1.1.7.1.

    I have the following problem.

    I have DISCOVERED called analysis. It has just a column with the result. Simple. Assume that the answer is 2500

    I have another scan which has two other columns, namely GOLD and LOANS. I want to calculate the total DISCOVERED + GOLD + READY.

    That's why I need to pass the value of 2500 of the first analysis of the second analysis via a variable.

    I can not add all three of them in the same analysis there are various filters for OVERDRAFT, and the application of these filters on the GOLD and LOANS gives the desired result. I tried to add filters in the column of the overdraft, but that doesn't seem to work.

    Any help will be greatly appreciated.

    I'll give you an example. I hope that you will mark for my time...

    Hope that you will be aware of how to combine a similar request.

    in the first criterion you have

    Goldprice Loanamount year 0

    Second criterion

    Year 0 0 Overdraftamount

    the two maintain the necessary filters.

    Add a column of result (option you can see in the topic area pane) that add all three columns. You can choose the columns. formula will come something like below

    saw_1 + saw_2 + saw_3

    Thank you

    AJ

  • How to send the values in a column of "report" instead of a "part of the Page?

    Hello

    Here's my case: two pages A and B.
    A page is used to display each employee of a selected service.
    Page B is used to create / modify employees.

    I create a button page which redirects to page B.
    By default, page B is empty (from course to fill in the blanks to create a new employee).

    However, there are 2 values I want to send to page B (I want to fill in some blanks in advance): the service and the Manager ID ID (there is a Department Manager).
    -I managed with the service ID because it is a page element and in the "Action when click on the button" button I filled "Set these Items"-> agenda of Page B "with the values"-> about a Page A day.
    -I am confused with the ID of eating because it is not a page element, but a report column and there is nothing to do like I did for the service in the button ID to create.

    I'm a bit lost cause I don't know how transfer/send this value to the second page.

    Do you have any idea?

    Thanks again for your time!

    BR

    Ulrich

    "Cleared Cache to Page 4, when an employee existing is being changed."

    Where did you get that? >

    On page 3, region staff, the report Employee ID attribute

    See Empty the Cache under the link column

    Glad to have helped.

    Jeff

  • How to extract the value of the element as an array in javascript

    Hi all

    I want to do some calculations on the value entered by the user in the textfield of a tabular presentation, how can I retrieve the value of the element as an array in javascript?

    I use as a normal, do not use in the form of apex_item.

    I can pass the current value of the textfield to the function using 'this' as a parameter, but how can I retrieve the value of other lines of the same column?

    Thank you
    Tauceef

    If it is a page element wouldn't be better to make a calculation of point page when onload of the page? Just do a SQL as select sum (col1) of dual nationality or whatever is your table/column?

  • How to extract the value of the signature (appearance)

    I asked my users to create an appearance for their signature showing that the 'name' and 'logo '.  I want to create a script to verify this aspect and display an alert if they did not follow the rule to create a signature. the value property indicates the word < < dict > > is it possible to delete a signature via javascript, is it not meet requierments, prevent the signing, forcing an appeareance or just change the appearance by default so that the user should not change?

    No, you can do most of this with JavaScript. You have access to is the data in an object SignatureInfo returned by the field.signatureInfo method:

    http://livedocs.Adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.756.html

    With the field.signatureSetSeedValue method, you can preconfigure a specific field to use a specific named appearance, but I don't know how you would handle this for multiple users because their appearance signature names would be probably different: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.757.html

  • How to extract the value of the field in variable

    I want to be able to read the value of the field out of the browser and store in a variable for I can manipulate it. I tried several methods, that which no I can't find the proper syntax. My last is the following:

    . . Solve ("postal code", "/ip/", Source.DisplayContent, 1);

    I assumed that the Group should be able to draw from this, but it does not solve. I think my problem is the regular expression or index (that I had with the null value). Any help would be greatly appreciated as I have a tight deadline to achieve. Thank you.

    -John

    Hi John,.

    Why are you using web.window? Surely, you would use web.element?

    Concerning

    Wayne.

Maybe you are looking for