Updating multiple node in a single query

Hi
Shall I update multiple nodes (which satisfies the given condition) in a single query? From the prototype we suspect that all nodes in all document are not updated in the container.
Version: BDB XML 2.4 - Fedora core 4 Linux - C++ language
Query:
replace value of node collection()/File[@Id="57565C01327A"]//Entry[@Class="Measurement" and @Id="0"]/Attribute[@Name="apDlBhUtil"]/@Value with 8'
Result:
XmlException occurred with msg 'Error: Sequence does not match type node() - the sequence contains more than one item [err:XUTY0008], <query>:1:1'
We have tried running the query in both Lazy and Eager evaluation type. Please clarify that the issue is with the query/execution type or BDB XML doesn't support this feature?
Thanks
Santhosh

Santhosh,
Try:
for $i in collection()/File[@Id="57565C01327A"]//Entry[@Class="Measurement" and @Id="0"]/Attribute[@Name="apDlBhUtil"]/@Value return replace value of node $i with 8'The problem with your original is that the argument for "replace value of" needs to be a single item, not a sequence.
Regards,
George

Similar Messages

  • Multiple databases in a single query

    I need to query multiple databases in a single query.
    e.g.
    Database d1 contains table t1 with column id
    Database d2 contains table t2 with column id
    I need a query like
    SELECT * FROM t1, t2 WHERE t1.id = t2.id;
    is this possible in jdbc? if yes can anyone help with some sample code?
    thanks,
    Ashish Saraf

    It is not possible using the JDBC API to query tables in two or more databases using a single query. The reason is that a JDBC Connection is made to a single data source.
    However, some databases support the idea of federations or linked tables. What you do is inside the database manager link or federate a table that is present in another DBMS. Then, pose a single JDBC query to the one DBMS which will have its own table and links to the external tables.
    Another approach is to use a special JDBC driver with a built-in integration engine that will perform a query across multiple databases. In effect, the system poses separate queries to the different databases and integrates and joins the data together for you automatically on the client-side. That is much easier than doing it yourself in code, but that is also possible for simple queries.
    As part of my research program, we have released a shareware version of the UnityJDBC driver that can query multiple databases using a single SQL query. For more information, see:
    http://www.unityjdbc.com
    http://www.cs.uiowa.edu/~rlawrenc/research/projects.html
    Sincerely,
    Dr. Ramon Lawrence
    Assistant Professor
    Department of Computer Science
    University of Iowa
    [email protected]

  • How to calculate the individual sums of multiple columns in a single query

    Hello,
    Using Oracle 11gR2 on windows 7 client. I have a question on calculating sum() on multiple columns on different columns and store the results in a view. Unfortunately I could not post the problem here as it keeps on giving error "Sorry, this content is not allowed", without telling where or what it is! So I had to post it in the stack-overflow forum, here is the link: http://stackoverflow.com/questions/16529721/how-to-calculate-the-individual-sums-of-multiple-columns-in-a-single-query-ora
    Will appreciate any help or suggestion.
    Thanks

    user13667036 wrote:
    Hello,
    Using Oracle 11gR2 on windows 7 client. I have a question on calculating sum() on multiple columns on different columns and store the results in a view. Unfortunately I could not post the problem here as it keeps on giving error "Sorry, this content is not allowed", without telling where or what it is! So I had to post it in the stack-overflow forum, here is the link: http://stackoverflow.com/questions/16529721/how-to-calculate-the-individual-sums-of-multiple-columns-in-a-single-query-ora
    Will appreciate any help or suggestion.
    ThanksLooks like you want a simple group by.
    select
              yr
         ,      mnth
         ,      region
         ,     sum(handled_package)
         ,     sum(expected_missing_package)
         ,     sum(actual_missing_package)
    from test
    group by
         yr, mnth, region
    order by      
         yr, mnth, region;I wouldn't recommend storing your data for year / month in 2 columns like that unless you have a really good reason. I would store it as a date column and add a check constraint to ensure that the date is always the first of the month, then format it out as you wish to the client.
    CREATE TABLE test
         year_month                              date,
        Region                     VARCHAR2(50),
        CITY                       VARCHAR2(50),             
        Handled_Package            NUMBER,       
        Expected_Missing_Package   NUMBER,   
        Actual_Missing_Package     NUMBER
    alter table test add constraint firs_of_month check (year_month = trunc(year_month, 'mm'));
    ME_XE?Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
      2  Values (to_date('2012-nov-12', 'yyyy-mon-dd'), 'Western', 'San Fransisco', 200, 10, 5);
    Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
    ERROR at line 1:
    ORA-02290: check constraint (TUBBY.FIRS_OF_MONTH) violated
    Elapsed: 00:00:00.03
    ME_XE?Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
      2  Values (to_date('2012-nov-01', 'yyyy-mon-dd'), 'Western', 'San Fransisco', 200, 10, 5);
    1 row created.
    Elapsed: 00:00:00.01
    ME_XE?select
      2        to_char(year_month, 'fmYYYY')    as year
      3     ,  to_char(year_month, 'fmMonth')   as month
      4     ,  Region
      5     ,  CITY
      6     ,  Handled_Package
      7     ,  Expected_Missing_Package
      8     ,  Actual_Missing_Package
      9  from test;
    YEAR         MONTH                REGION                         CITY                    HANDLED_PACKAGE EXPECTED_MISSING_PACKAGE ACTUAL_MISSING_PACKAGE
    2012         November             Western                        San Fransisco                       200                       10                      5
    1 row selected.
    Elapsed: 00:00:00.01
    ME_XE?Then you have nice a nice and easy validation that ensures you data integrity.
    Cheers,

  • How to insert multiple records in a single query

    Dear all,
    Can you please tell
    how to insert multiple records in a single query ??

    INSERT INTO table_name (column_1, column_2) VALUES ('value_A', 'value_B')OR
    INSERT INTO table_name
    (column_1, column_2)
    SELECT 'value_A', 'value_B' FROM DUAL
    UNION ALL
    SELECT 'value_C', 'value_D' FROM DUAL
    ;Edited by: Benton on Nov 9, 2010 1:59 PM

  • How can I update the table with a single query for...

    I have a table with columns C1 and C2.
    C1 C2
    A1 null
    A1 null
    A1 null
    A1 null
    A2 null
    A2 null
    A2 null
    A3 null
    A4 null
    A4 null
    I want to update my table with a single query so that I would have data like
    C1 C2
    A1 1
    A1 2
    A1 3
    A1 4
    A2 1
    A2 2
    A2 3
    A3 1
    A4 1
    A4 2
    The updated column C2 has the values like serial no grouped on the column C1.

    SQL> create table mytable
      2  ( c1 varchar2(2)
      3  , c2 number(2)
      4  )
      5  /
    Tabel is aangemaakt.
    SQL> insert into mytable (c1)
      2  select 'A1' from dual union all
      3  select 'A1' from dual union all
      4  select 'A1' from dual union all
      5  select 'A1' from dual union all
      6  select 'A2' from dual union all
      7  select 'A2' from dual union all
      8  select 'A2' from dual union all
      9  select 'A3' from dual union all
    10  select 'A4' from dual union all
    11  select 'A4' from dual
    12  /
    10 rijen zijn aangemaakt.
    SQL> select * from mytable
      2  /
    C1                                     C2
    A1
    A1
    A1
    A1
    A2
    A2
    A2
    A3
    A4
    A4
    10 rijen zijn geselecteerd.
    SQL> merge into mytable t1
      2  using (select c1
      3              , row_number() over (partition by c1 order by null) rn
      4              , rowid rid
      5           from mytable
      6        ) t2
      7     on (t1.rowid = t2.rid)
      8   when matched then
      9        update set c2 = rn
    10   when not matched then
    11        insert values (null,null)
    12  /
    10 rijen zijn samengevoegd.
    SQL> select * from mytable
      2  /
    C1                                     C2
    A1                                      1
    A1                                      2
    A1                                      3
    A1                                      4
    A2                                      1
    A2                                      2
    A2                                      3
    A3                                      1
    A4                                      1
    A4                                      2
    10 rijen zijn geselecteerd.Regards,
    Rob.

  • Merge statement - update multiple columns from a single sub-select

    Is it possible to write in 10gR2, a MERGE statement, with UPDATE for multiple columns from a single sub_select?
    like this:
    MERGE INTO tableA
    using ( select * from temp) tmp
    on( tableA. col1 = tmp.col1)
    when matched then
    update set  ( tableA.col5,
                       tableA.col6,
                       tableA.col7) = ( select sum(col2), sum(col3), sum(col5)
                                                                                 from tableX
                                                                                where tableX.col1 = tableA.col1...)

    Hi,
    The USING clause is not a sub-query, so it can't reference columns from tables that are not in it.
    Include tableA in the USING clause if you really need to refer to it there. (It's not obvious that you do.)
    As always, it helps if you post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data (In the case of a DML statement, such as MERGE, this will be the state of the tables when everything is finished.)
    (4) Your best attempt so far (formatted)
    (5) The full error message (if any), including line number
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    If you can present your problem using commonly available tables (for example, tables in scott schema, or views in the data dictionary), then you can omit (2).
    Formatted tabular output is okay for (3).

  • Query Design Strategies - servicing multiple reports from a single query

    I was wondering if anyone knew of any good web resrouces (articles and such) to assist with Query Design Strategies. What I am specifically looking to do is replace multiple reports from the previous system with just views of a single query. So I was looking at grouping the existing reports that we are replacing into queries and creating views for each report.
    The catch is that we will only be utilizing web reporting for report distribution, so we need to:
    1. Use views as DataProviders to web templates
    2. Broadcast views to users as links where they can see that particular view
    Is this possible and does anyone have some info on how to do this?

    Lets say that 10 broadcasted reports all could use the same query but each in a different navigational state.
    1. Can you navigate the query and save as a view and then set up a brodacast rule for that view?
    2. Can a DataProvider in a web template be a view?
    3. Can the BI Launcher iView take a view name in place of a query?
    <prt_protcl>://<prt_server>/<bi_launcher>?TEMPLATE=TEST1&QUERY=TEST2

  • Update or select in a single query

    Hi , I want to select or update from a single query. Can I do that ?
    I tried Merge into, but it is for Update or Insert.
    Can anyone help me please. I do not want to use stored Proc/function.

    userPrasad wrote:
    I want to fire a update or merge statement inside a select SQL. Is there any way to do that ?Just to clarify:
    It is possible to UPDATE based on a SELECT condition within SQL, i.e.,
    UPDATE table1 t1
       SET col1 = new_val
    WHERE col2 IN (
        SELECT col2
           FROM table2 t2
          WHERE t1.col1 = t2.col1
              AND col1 = old_val);or to MERGE:
    MERGE into table1 t1
    USING (SELECT * FROM table2) t2
      ON (t1.col1 = t2.col1)
    WHEN MATCHED...
    WHEN NOT MATCHED...Both of those will use a SELECT, and MERGE can UPDATE, INSERT, both or either one, or none.
    Is that what you had in mind?

  • How to use multiple aggregate functions in single query

    hi to all
    The output will be giving first_name,last_name,max(salary),min(salary) and the output will be department wise.From employees table in single query
    output will be:
    first_name|last_name|max(salary)|min(salary)

    SELECT first_name||' '||last_name as ename,
           MIN(sal) KEEP (DENSE_RANK FIRST ORDER BY sal) OVER (PARTITION BY deptno) "Lowest",
           MAX(sal) KEEP (DENSE_RANK LAST ORDER BY sal) OVER (PARTITION BY deptno) "Highest"
    FROM   emp
    ORDER BY deptno, sal;Edited by: Ramio on Jan 10, 2012 10:43 PM

  • How to calculate multiple aggregation in a single query

    how to find firstname ,lastname for max and min salary from employees table group by department in a single query?
    Edited by: Gnanasekar on Jan 10, 2012 6:36 AM

    check this query
    select ENAME,SAL
    from EMP
    where SAL in(select max(SAL)
                       from EMP
                      group by DEPTNO)
    or SAL in(select min(SAL)
                 from EMP
                  group by DEPTNO)Hope this will help you..
    You should ask this question at sql/plsql forum
    If someone's response is helpful or correct, please mark it accordingly.

  • How to update multiple tables using results from query

    I'm a bit rusty on this stuff and am hoping for some help.
    Table 1 is:
    location_id, location_name
    Table 2 is
    location_id, employee_id and misc. other columns
    Then there are multiple tables with associated data, keys being location_id and employee_id.
    There are no established relationships.
    Trying to come up with a process to change location_id for all employees assigned to a particular location.
    It seems to me that the basics are
    select employee_id from Table2 where location_id='xxxxxx'
    Then take each employee_id returned and change their location_id in each of the other tables
    I'm not clear on how to load the returned employee id's as variables and then loop through them.
    Thanks

    Thanks for the welcome. I'll read up on the rules now.
    Below is the DDL for a couple of the tables.
    Version = 11g
    I would query the users table for all users with a certain site_id and then use them to update the site_id in the users table (and other tables)
    -- DDL for Table USERS
    CREATE TABLE "USERS"
    (     "USERID" VARCHAR2(8 BYTE),
         "PASSWORD" VARCHAR2(50 BYTE),
         "FIRST_NAME" VARCHAR2(50 BYTE),
         "LAST_NAME" VARCHAR2(50 BYTE),
         "SITE_ID" VARCHAR2(5 BYTE),
         "ROLE_ID" VARCHAR2(1 BYTE)
    ) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "SITES_DATA_TS"
    CACHE ;
    -- DDL for Table EMPLOYEE_PROFILE
    CREATE TABLE "EMPLOYEE_PROFILE"
    (     "EMPLOYEEID" VARCHAR2(9 BYTE),
         "PROGRAM" NUMBER,
         "REQUIREMENT" NUMBER,
         "JOBNUM" VARCHAR2(50 BYTE),
         "STATUS" VARCHAR2(50 BYTE),
         "PROGRAM_TYPE" VARCHAR2(50 BYTE),
         "SITE_ID" VARCHAR2(5 BYTE),
         "NUM_QUAL_TEST_ATTEMPTS" NUMBER(7,0)
    ) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "SITES_DATA_TS"
    CACHE ;

  • Can LabView simulate multiple nodes on a single CAN bus?

    We currently are developing a system where a single control panel controls a number of drive motors over a CAN bus.  Each of those drive motors has electronics and software in them which tracks the status of the motor, and this information is sent over the CAN bus to the control panel.
    We have previously used Vector CANoe to simulate the activity of the drive motor nodes on the CAN bus during development of the control panel.  We want to move to LabView in order to run this kind of simulation.
    Is it possible for LabView to be used to run this kind of simulation?  Each node would have its own CAN ID on the bus.  It would need to send out appropriate periodic status messages on that CAN bus that would be based on user inputs.  It would also need to display certain information based on commands sent to it via the control panel over CAN.
    Thanks for the assistance.

    Hi,
    I believe that what you need is to simulate several CAN ports. There is a similar discussion form that I believe will answer you question. I hope this helps.
    Regards
    Krista S.
    Applications Engineering
    National Instruments

  • Display Multiple reports in a single query view

    Hi Team,
    I have 3 similar reports for MTD, QTD & YTD.
    While displaying the report in the portal..  I want to display the reports in a single view wherein the MTD report will be a default report for the input selections. whereas the QTD & YTD will be available as dropdown options in the same query view and the wll be executed for the same input selections.
    Please advice how to design the view.
    Regards
    Sneha

    Hi All,
    I have created a Web Template for my requirement.
    Now while adding the template to my Transport request, I am getting the following error message:
    Object 'BTMP::0ANALYSIS_PATTERN_EXPORT' refers to the invalid object 'QU::'
    Object 'BTMP::0ANALYSIS_PATTERN_INFO' refers to the invalid object 'QU::'
    PLEASE ADVICE...
    Regards
    Sneha
    Edited by: Sneha Santhanakrishnan on Aug 8, 2011 12:18 PM

  • How to insert multiple records with a single query?

    Hi,
    I've to save a huge number of installments with their other information such as due on blah blah. Now, I want to add the all of these information at once with a single insert query.
    How can I do that?

    Hi
    What is your source data?
    If the source is external to the SQL Server (like a log file, Excel, CSV, JSON, XML, external application...) you can and should insert it all using Bulk Insert operation.
    Pls clarify what is your source data, and if you need more help using Bulk Insert.
    https://www.simple-talk.com/sql/learn-sql-server/bulk-inserts-via-tsql-in-sql-server/
    http://msdn.microsoft.com/en-us/library/ms188365.aspx
    [Personal Site] [Blog] [Facebook]

  • Updating two table from a single query

    I have two table such as
    user_log(user_id , password)
    and
    user_info(user_id , name , age , address , sex , email , contact)
    If I want to add data from a single form in php then what is the query?

    Hi,
    welcome to the forum..! plesae always post table data and expected result to help forum members help you better.
    From what I understand, all you need is a join on userid (assuming userid is unique/primary key )
    select ul.userid,
             ul.password,
            ui.name,
            ui.age
      from user_log ul,
              user_info ui
      where ul.user_id = ui.user_id
        ---- and any otehr condition for the user that you need.(where clause)In PHP......(based on this link.. http://wiki.oracle.com/page/PHP+Oracle+FAQ
    haven't tested the code.. )
    <?php
    $conn = oci_connect("scott", "tiger", "localhost/XE");
    if (!$conn) {
    $m = oci_error();
    echo $m["message"];
    exit;
    $stid = oci_parse($conn, "select ul.userid,
             ul.password,
            ui.name,
            ui.age
      from user_log ul,
              user_info ui
      where ul.user_id = ui.user_id");
    oci_execute($stid);
    // Query the table
    echo "<table border='1'>";
    while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
    echo "<tr>";
    foreach ($row as $item) {
    echo "<td>".($item!==null?htmlentities($item):" ")."</td>";
    echo "</tr>".PHP_EOL;
    echo "</table>";
    oci_free_statement($stid);
    oci_close($conn);
    ?>Try to provide more details.. if this is not what you are looking for.
    Hope this helps,
    Rajesh.

Maybe you are looking for

  • Bridge 4 html gallery modification

    I have been using a custom set of html templates for web photo galleries with CS3. The identical feature can be invoked from Bridge/Photoshop CS4 with the provided "extra" plugin. However, is there any way to tailor the "output / web gallery", html g

  • TV Shows to DVD?

    Is it possible to burn the shows that I downloaded from the iTunes music store to DVD? I'm interested in saving LOST to DVD and then watching it on my TV instead of on my iPod or laptop. Thanks in advance!

  • How we can handle signed packed datatype  in ODI

    Hi I am generating target file from oracle as source. but i need to pack some numeric field into signed packed format. there are two type of numeric values 1)1234 2)1234.23 i am getting successfully packed value in case of 1234. In case of packing 12

  • Random error notification that goes on then disappears in a millisecond

    Just a random error that goes on every time i go on my computer and goes of in a millisecond.

  • Re: (forte-users) Distributed Property

    You have the answer. A class should set "Subclass Override" to TRUE (or ON) if it wants any of its derived classes to override the behaviour. If you want your subclass to be able set its Runtime properties (Distributed, Shared, Transactional, Monitor