Problem in update Query of  MySQL

Hi
I have a large amounts of records in a teble & i want to update the records in a particular condition but it takes time in updating.
I have also used batch update but it's also not going to solve my problem.
can anyone help what should i do to frequently update in a large amount of data.
I am using MySQL along with core java.

It's not a Java question but more of a database profiling question. Try to post your description of the problem and the query in a MySQL forum.
Kaj

Similar Messages

  • Problem with update-query

    Hallo,
    i have a problem with following query. I wanna update the columns in the nutzung table. There are 7 columns but my query updates the geometry that in all columns is the same geometry or I can not update because the query gives more than 1 row in the subquery.
    update nutzung
    set geometrie=(SELECT F1840_GEOM FROM UG_F1840_GEOM,Nutzung WHERE NUTZUNG.OBJNR=UG_F1840_GEOM.F1840_OBJNR AND GETFEATUREID(UG_F1840_GEOM.F1840_FID) IN(SELECT MSLINK FROM FEATURE WHERE FCODE like '%0000'));
    Maybe I need the ug_f1840_geom table in the update query. Don't know how to change the query.
    Regards, Katrin

    hi it's me again .I am getting error for this
    statement
    if(numOfUsers>0)
    stmt.executeUpdate("update defaultchatrooms set
    s set nodename =
    '"+chatTopic+"'('"+numOfUsers+"')'");
    1. Your update string looks like this:
    update defaultchatrooms set nodename = 'someChatTopic'('0')'
    Does that look right to you?
    2. This will update the column nodename in every row in the table defaultchatrooms. Aren't you missing a "where" condition?

  • Problem: Jstl update query with Jquery script

    Hi all,
    i'm writing a jsp page with this 3 star rating Jquery script to show and vote some <div> (results) .
            <script type="text/javascript">
                                        jQuery(document).ready(function($) {
                                            $("#${Rss.pages_id}").stars({
                                                cancelShow: false,
                                                captionEl: $("#<%=i%>"),
                                                callback: function(ui, type, value){
                                                    alert("Callback! ID = ${Rss.pages_id} Clicked: " + type + ", value: " + value );
                                            $("#${Rss.pages_id}").stars("select", ${Rss.trust_value})
                                    </script>Now i want update the value in my DB(MySql) everytime that i will click on my "star rating"..i want do this with an jstl update query.
    Someone can help me?? Thanks

    Just so as you remember that jquery/javascript is completely client side.
    JSP/JSTL is completely server side.
    The only way to invoke java/JSP from javascript code is to make an http request - normally via ajax.
    Given that, it doesn't make sense to put jquery code and a JSTL update query within the same JSP page.
    The code to update the database should be a seperate resource called by ajax from the main page.
    In that case, it doesn't have to be (and probably shouldn't be) done with JSTL. It is better done with java code within servlet/beans.
    cheers,
    evnafets

  • Problem with update query on unique constraint(java programmer)

    Hi ,
    i created one table called mytab
    mytab there are two columns
    1)no 2)name
    no is unique
    there are two record 1 and 2
    mytab
    no name
    1 a
    2 b
    i want to update 1 record to 2
    and first record to 2
    i am using batchexecute
    str1="update mytab set no=1 where no=2"
    str2="update mytab set no=2 where no=1";
    st.addBatch(str1);
    st.addBatch(st2);
    st.executeBatch();
    and i am getting this exeception
    java.sql.BatchUpdateException: error occurred during batching: ORA-00001: unique constraint (EPRDEV.SYS_C0017184) violated
    is there any solution
    dont say change first record to null and then change it as second then so on
    why because there are so many records are there .
    other than using null as halt any other solution.
    please help
    with regards

    Well, you can almost do it. You see, although str1 will set col no to 1 where no = 2, now you will have two rows where no = 1. So str2 will update two rows to 2. If you can avoid this problem then you will use deferrable unique constraint supported by a non unique index to do what you want.
    eg.
    SQL>  create table t (no number, name varchar2(10));
    Table created.
    SQL> create index t_x on t(no);
    Index created.
    SQL> alter table t add constraint t_ux unique (no) deferrable using index;
    Table altered.
    SQL> insert into t values (1, 'a');
    1 row created.
    SQL> insert into t values (2, 'b');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t;
            NO NAME
             1 a
             2 b
    2 rows selected.
    SQL> set constraint t_ux deferred;
    Constraint set.
    SQL> update t set no = 2 where no =1;
    1 row updated.
    SQL> update t set no = 1 where no = 2;
    2 rows updated.
    SQL> rollback;
    Rollback complete.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Doubt in Update query

    I have a problem using update query, for updating one column in a table with another column in another table. For eg say i have two tables, collector and survey
    Fields in Collector:
    col_n_account_num
    col_v_email
    col_n_phone_number
    Fields in survey
    sur_v_question_id
    sur_n_account_num
    sur_v_response
    update collector
    case when sur_v_question_id=collector_email then col_v_email=sur_v_response end,
    case when sur_v_question_id=collector_phone then col_n_phone_number=sur_v_response end
    Thanks in advance
    Regards,
    ss

    write two simple update statements
    update collector set col_v_email =
    (select sur_v_response from survey
    where sur_v_question_id=collector_email )
    and
    update collector set col_n_phone_number =
    (select sur_v_response from survey
    where sur_v_question_id=collector_phone)

  • Update query is slow with merge replication

    Hello friend,
    I have a database with enabling merge replication.
    Then the problem is update query is taking more time.
    But when I disable the merge triggers then it'll update quickly.
    I really appreciate your
    quick response.
    Thanks.

    Hi Manjula,
    According to your description, the update query is slow after configuring merge replication. There are some proposals for you troubleshooting this issue as follows.
    1. Perform regular index maintenance, update statistics, re-index, on the following Replication system tables.
        •MSmerge_contents
        •MSmerge_genhistory
        •MSmerge_tombstone
        •MSmerge_current_partition_mappings
        •MSmerge_past_partition_mappings
    2. Make sure that your tables involved in the query have suitable indexes. Also do the re-indexing and update the statistics for these tables. Additionally, you can use
    Database Engine Tuning Advisor to tune databases for better query performance.
    Here are some related articles for your reference.
    http://blogs.msdn.com/b/chrissk/archive/2010/02/01/sql-server-merge-replication-best-practices.aspx
    http://technet.microsoft.com/en-us/library/ms177500(v=sql.105).aspx
    Thanks,
    Lydia Zhang

  • Update query problem

    Hello
    I'm trying to write an update query either in a single statement or stored procedure that updates a numeric column based on a date column. I do this using:
    UPDATE DATE SMSCLOSED_CTYWOA SET 'date_action_start' = to_number(to_char('action_date' ,'MMDDYY')); No big deal. The problem is both column names have apostrophe's in their name (i.e. '). When I run this query the 'action_date' segment returns an error:
    ERROR at line 1:
    ORA-01747: invalid user.table.column, table.column, or column specification
    Any advice would be appreciated.
    Thanks in advance.

    If you had a normal table, like:
    Name Null? Type
    DATE_ACTION_START NUMBER(6)
    ACTION_DATE DATE
    the command would be:
    UPDATE smsclosed_ctywoa
    SET date_action_start = TO_NUMBER(TO_CHAR(action_date,'MMDDYY'));
    However, if you have a table like:
    Name Null? Type
    'date_action_start' NUMBER(6)
    'action_date' DATE
    which is a really poor table design, then the command would be:
    UPDATE smsclosed_ctywoa
    SET "'date_action_start'" = TO_NUMBER(TO_CHAR("'action_date'",'MMDDYY'));
    Note that, in both cases, there is no DATE after the word UPDATE.
    In the second case, if your column names have apostrophes and are in lower case, which is a really bad design, then you need to enclosed them in double quotes.
    Another thing you should be aware of is that, because date_action_start is a number field, you will be losing the leading zeroes, so July 9, 2001 will be 70901, not 070901.
    It looks like you need to seriously reconsider your table design.
    null

  • Problem for running Update query with Chinese

    Hi all,
    I am running a web application in Lotus Domino.
    I have a Lotus Script Agent which need to update Oracle 8i Database with Chinese Character throught ODBC but i find that all characters become some strange characters.
    I got the problem only for update query.
    I have no problem for select query for getting the chinese data.
    Also, I got no problem to run the update query with chinese characters in Sqlplus.
    I also try to run the same update query which the ODBC connection is pointing to an MS Access Database. It works too.
    So the only things i leave is the Oracle ODBC driver.
    Anythings I should do for the Oracle ODBC server?
    Thanks very much.

    Hi, I checked the registry of Oracle and
    in the NLS_LANG field, the values is AMERICAN_AMERICA.UTF8. In the server side, I set the same.
    It should be okay, as i can retrieve the chinese content in the Oracle. Just that when i try to run a query contain chinese, such as,
    "insert into TableA values ('���')". i will got some strange character inserted in the databasae.
    Could you tell me what should i do?
    Thanks a lot a lot.

  • Whats wrong with my UPDATE query?????????

    Hi friends,
    I used an update query in my project but it doesnt seems to be work fine.
    And here is my query:
    String SQL1="UPDATE tbl_rmadetails SET serial_no="+serial_no+" AND replaced_serial_no="+replaced_serial_no+" AND status="+status+"AND customer_id="+custo+"AND item_id="+ite+" WHERE customer_id="+custo+"AND item_id="+ite;
    Did i mess up the query..
    Is it?
    If not then whats the problem.
    I use PreparedStatement to execute the query.
    Any help will be appreciated

    So if i have 16 fields and i want to update only 5 fields means i gotta leave other fields like the below one..
    String SQL2="UPDATE tbl_rmadetails SET serial_no="+serial_no+","+ "replaced_serial_no="+replaced_serial_no+","+ "status="+status+","+"customer_id="+custo+"," +"item_id="+ite+"WHERE customer_id="+custo+"AND item_id="+ite+" AND serial_no="+serial_no;
                             ps=con.prepareStatement(SQL2);
                             ps.setString(3,custo);
                             ps.setString(4,ite);
                             ps.setInt(8,serial_no);
                             ps.setInt(10,replaced_serial_no);
                             ps.setString(11,status);
                             x=ps.executeUpdate();It gives me an error like this one in my console...
    java.sql.SQLException: Parameter index out of range (3 > 0).
            at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:2
    001)
            at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:110
    3)
            at com.rajk.javacode.servlets.RMAEntryModel.updateOut(RMAEntryModel.java
    :310)
            at com.rajk.javacode.servlets.RMAOutServlet.doPost(RMAOutServlet.java:31
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:175)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
    a:286)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
    ss(Http11Protocol.java:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
    7)
            at java.lang.Thread.run(Unknown Source)I dont want to update other fields.. i leave them as it is.. i juz want to know whether i could update only necessary fields out of all?
    ANyhelp would be appreciated

  • Update query not working from edit page

    Next incident with the guestbook saga:
    Successful execution of gb_entry_mstr_det_e.cfm with URL:
    http://www.benoitsystems.com/ww/bd/gb/gb_entry_mstr_det_e.cfm?call_number=14 all have database current info...this is good, but:
    textboxes
    Problem 1:
    the SELECT field does not does not reflect/display the correct option I know exists in the database
    the database field whence this SELECT object is supposed to display is a number, not text.
    now,...
    Problem 2:
    Clicked on "Update Your Entry" button at bottom of edit page (to update by going to gb_confirm_update.cfm)
    <INPUT
    TYPE="submit"
    NAME="submit"
    VALUE="Update Your Entry">
    then, arriving at the gb_confirm_update.cfm page, ...
    Got an error (below) executing the page: gb_confirm_update.cfm with resulting URL:
    http://www.benoitsystems.com/ww/bd/gb/gb_confirm_update.cfm?call_number=#gb_entryID#
    --- snippet from template gb_confirm_update.cfm
    <CFQUERY DATASOURCE="9130.ww" NAME="ww_gb_ud">
    UPDATE gb_entries
    SET
    gb_entry_stts_='form.gb_entry_stts_',
    gb_entry_nm_f='form.gb_entry_nm_f',
    gb_entry_nm_l='form.gb_entry_nm_l',
    gb_entry_nm_l_dspl_x=form.gb_entry_nm_l_dspl_x,
    gb_entry_tce='form.gb_entry_tce',
    gb_entry_tce_dspl_x=form.gb_entry_tce_dspl_x,
    gb_entry_cy='form.gb_entry_cy',
    gb_entry_stt='form.gb_entry_stt',
    gb_entry_instr='form.gb_entry_instr',
    gb_entry_m='form.gb_entry_m',
    gb_entry_del_x=form.gb_entry_del_x
    WHERE gb_entryID=form.gb_entryID
    </CFQUERY>
    --- end snippet ---
    =================================================
    Error Executing Database Query. 
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4. 
    The error occurred in E:\benoitsystems.com\wwwroot\ww\bd\gb\gb_confirm_update.cfm: line 2
    1 : <!--- <CFUPDATE DATASOURCE="9130.ww" TABLENAME="gb_entries"> --->
    2 : <CFQUERY DATASOURCE="9130.ww" NAME="ww_gb_ud">
    3 : UPDATE gb_entries
    4 : SET
    SQL    UPDATE gb_entries SET gb_entry_stts_='form.gb_entry_stts_', gb_entry_nm_f='form.gb_entry_nm_f', gb_entry_nm_l='form.gb_entry_nm_l', gb_entry_nm_l_dspl_x=form.gb_entry_nm_l_dspl_x, gb_entry_tce='form.gb_entry_tce', gb_entry_tce_dspl_x=form.gb_entry_tce_dspl_x, gb_entry_cy='form.gb_entry_cy', gb_entry_stt='form.gb_entry_stt', gb_entry_instr='form.gb_entry_instr', gb_entry_m='form.gb_entry_m', gb_entry_del_x=form.gb_entry_del_x WHERE gb_entryID=form.gb_entryID 
    DATASOURCE   9130.ww
    VENDORERRORCODE   -3010
    SQLSTATE   07002
    Please try the following:
    Check the ColdFusion documentation to verify that you are using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.
    Browser   Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Remote Address   71.233.234.226
    Referrer   http://www.benoitsystems.com/ww/bd/gb/gb_entry_mstr_det_e.cfm?call_number=14
    Date/Time   21-Jul-10 03:11 PM
    =================================================
    I have every NAME of each object matching, verbatum, in the UPDATE query, and every database field name correct in teh query also.

    I was encouraged to send snippets in an another submission, and now I believe it is best that I  "lay my cards on the table"
    Here's my hand:
    Pages in question for your review:
    http://www.benoitsystems.com/ww/bd/gb/gb_mstr.cfm  click on the pencil (the toilet will delete the record.
    http://www.benoitsystems.com/ww/bd/gb/gb_entry_mstr_det_e.cfm?call_number=21  go to bottom of webpage and click “Update Your Entry”
    http://www.benoitsystems.com/ww/bd/gb/gb_confirm_update.cfm?call_number=#gb_entryID#
    In your review of the above (should you choose) before clicking on the pencil, look at the status on the master listing record you will be editing, and feel free to edit.  Most statuses will be “Hold”
    Two dummy MS Access database tables:
    Table 1: "gb_entries" (Guestbook)
    field 1: gb_entries_ID (Autonumber - Long Integer)
    field 2: gb_entries_dt (date/time)
    field 3: gb_entries_nm_f (Text)
    field 4: gb_entries_nm_l (Text)
    field 5: gb_entries_nm_stts_ (Number field - Byte (not bit)) (fed by gb_sttsID)
    couple other text fields
    field 6: gb_entries_em (Text)
    field 7: gb_entries_cy (Text)
    field 8: gb_entries_stt (Text)
    field 9: gb_entries_nm_l_dspl (Yes/No or True/False)
    field 10: gb_entries_m (Memo type)
    Table 2: "gb_stts_rf" (Guestbook Status Reference)
    field 1: gb_sttsID (Autonumber - Long Integer)
    field 2: gb_stts (Text)
    Two Templates:
    This is the edit page (where a person with administrative access may edit the status or change the spelling for someone, etc.):
    <!--- This query fills the form with the chosen record data (except for the darned SELECT object) ---> <CFQUERY NAME="edit_entry" DATASOURCE="9130.ww"> SELECT * FROM gb_entries WHERE #call_number#=gb_entryID </CFQUERY>
    <!--- This query is for the select dropdown of guestbook status options (set to default on “Hold” from gb_nw.cfm) ---> <CFQUERY NAME="q_stts" DATASOURCE="9130.ww"> SELECT * FROM gb_stts_rf </CFQUERY>
    <HTML>
    <HEAD>
    <TITLE>Woodwindology Guestbook Entry Edit Page</TITLE> <CFOUTPUT QUERY="incl_css_bd">#incl_code#</CFOUTPUT>
    </HEAD>
    <BODY
          BGPROPERTIES="fixed">
    <DIV ALIGN="center">
    <IMG
          SRC="<CFOUTPUT>#baseurl#</CFOUTPUT>md/img/ut/ttl/pg/guestbook.gif"
          BORDER="0">
    <BR>
    <IMG
          SRC="<CFOUTPUT>#baseurl#</CFOUTPUT>md/img/ut/ttl/sub/edit_entry.gif"
          BORDER="0">
    <BR>
    Developer View
    </DIV>
    <TABLE>
          <TR>
                <TD>
                      <TABLE
                            WIDTH="100%"
                            BORDER="0"
                            CELLPADDING="5"
                            CELLSPACING="0">
          <TR>
                <TD VALIGN="top">
                      <FORM
                            NAME="f_gb_entry_mstr"
                            ACTION="gb_confirm_update.cfm?call_number=#gb_entryID#"
                            METHOD="post">
                      <CFOUTPUT QUERY="edit_entry">
                      <B>Entry ID:</B>
                      #gb_entryID#     
                      <INPUT
                            TYPE="hidden"
                            NAME="gb_entryID"
                            VALUE="#gb_entryID#">
                      <P>
                      <B>Entry Date and Time:</B>
                      #DateFormat("#gb_entry_dt#","mmmm d, yyyy")# #TimeFormat("#gb_entry_dt#","h:mm tt")#
    <P>
                      <B>Entry Status:</B>
                      <SELECT
                            NAME="gb_entry_stts_"
                            VALUE="#gb_entry_stts_#">
    </CFOUTPUT>
                            <CFOUTPUT QUERY="q_stts">
                                  <OPTION VALUE="#gb_sttsID#">#gb_stts#</OPTION>
                            </CFOUTPUT>
                      </SELECT>
                      <P>
    <CFOUTPUT QUERY="edit_entry">
                      <B>Guest's First Name:</B>
                      <INPUT
                            TYPE="text"
                            NAME="gb_entry_nm_f"
                            VALUE="#gb_entry_nm_f#">
                      <P>
                      <B>Guest's Last Name:</B>
                      <INPUT
                            TYPE="text"
                            NAME="gb_entry_nm_l"
                            VALUE="#gb_entry_nm_l#">
                      <BR>
                      Display Last Name:
                      <INPUT
                            TYPE="radio"
                            NAME="gb_entry_nm_l_dspl_x"
                            VALUE="Yes">
                      Do Not Display Last Name:
                      <INPUT
                            TYPE="radio"
                            NAME="gb_entry_nm_l_dspl_x"
                            VALUE="no">
                            <P>
                            <B>Your Email Address:</B><BR>
                            <INPUT
                                  TYPE="text"
                                  NAME="gb_entry_tce"
                                  VALUE="#gb_entry_tce#"
                                  SIZE="40"
                                  MAXLENGTH="40">
                      <BR>
                      Uncheck the box to keep email private:
                      <INPUT
                            TYPE="checkbox"
                            NAME="gb_entry_tce_dspl_x"
                            VALUE="#gb_entry_tce_dspl_x#">
                      <P>
                      <SPAN CLASS="emph01">*</SPAN> Your City:
                      <INPUT
                            TYPE="text"
                            NAME="gb_entry_cy"
                            VALUE="#gb_entry_cy#"
                            SIZE="30">
                      <P>
                      <SPAN CLASS="emph01">*</SPAN> Your State:
                      <INPUT
                            TYPE="text"
                            NAME="gb_entry_stt"
                            VALUE="#gb_entry_stt#"
                            SIZE="30">
                      <BR>
                            <B>Instruments Played:</B>
                      <BR>
                            <TEXTAREA
                                  COLS="45"
                                  MAX="50"

  • How to use xs:date() in an update query?

    I cannot test xs:date attributes in an "update" query. In a "select" query, all work fine.
    This is the sample schema:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Created with Liquid XML Studio 1.0.8.0 (http://www.liquid-technologies.com) -->
    <xs:schema xmlns:tns="http://OracleTest" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified" targetNamespace="http://OracleTest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="MyComplexType">
    <xs:sequence>
    <xs:element minOccurs="0" name="FirstChild">
    <xs:complexType>
    <xs:attribute name="A" type="xs:string" />
    <xs:attribute name="B" type="xs:string" />
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    <xs:attribute name="ID" type="xs:string" />
    <xs:attribute name="DateAttr" type="xs:date" />
    </xs:complexType>
    <xs:element xdb:defaultTable="MyElement" name="MyElement" type="tns:MyComplexType" />
    </xs:schema>
    This is a sample XML document:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Created with Liquid XML Studio 1.0.8.0 (http://www.liquid-technologies.com) -->
    <tns:MyElement ID="ID1" xmlns:tns="http://OracleTest" DateAttr="2008-03-14" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://OracleTest http://OracleTest.xsd">
    <tns:FirstChild A="a" B="b" />
    </tns:MyElement>
    If I check the DateAttr attribute in a xquery, it works fine:
    select xmlquery('declare default element namespace "http://OracleTest"; collection("/Testing")/MyElement[@DateAttr=xs:date(''2008-03-14'')]' returning content).getclobval() from dual
    If I execute an update, like this:
    UPDATE RESOURCE_VIEW SET RES = deleteXML(RES, '/oraxdbr:Resource/oraxdbr:Contents/Testing/MyElement[@DateAttr=xs:date(''2008-03-14'')]','xmlns:oraxdbr="http://xmlns.oracle.com/xdb/XDBResource.xsd" xmlns="http://OracleTest"')
    WHERE equals_path(RES, '/Testing/test1.xml') = 1
    I get the error:
    SQL Error: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00607: Invalid reference: 'date'.
    31011. 00000 - "XML parsing failed"
    Where is the problem?
    Thank you!
    Mirko

    Hi,
    Correct me if I'm wrong, but didn't xs:date() came with xpath 2.0?
    deleteXML supports xpath 1.0 .
    XMLQuery supports xpath 2.0.
    That's why the error "Invalid reference: 'date'".
    what function supports which version read Re: Which version of XPathAnts

  • Problem in Update statement using Execute Immediate

    Hi All,
    I am facing problem in update statement.
    I am creating dynamic sql and use "execute immediate" statement to execute a update statement.
    But it is not updating any thing there in the table.
    I have created a query like :
    update_query='Update '|| Table_Name ||' t set t.process_status =''Y'' where t.tid=:A';
    Execute immediate update_query using V_Id;
    commit;
    But it is not updating the table.
    I have a question , is execute immediate only does insert and delete?
    Thanks
    Ashok

    SQL> select * from t;
                     TID P
                     101 N
    SQL> declare
      2     V_Id          number := 101;
      3     Table_Name    varchar2(30) := 'T';
      4     update_query  varchar2(1000);
      5  begin
      6     update_query := 'Update '|| Table_Name ||' t set t.process_status =''Y'' where t.tid=:A';
      7     Execute immediate update_query using V_Id;
      8     commit;
      9  end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> select * from t;
                     TID P
                     101 Y                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How Can Improve On Slow Update Query Using /*+ NO_XML_DML_REWRITE */?

    We have an update query recently brought to my attention that is running extremely slow on Oracle 11.2.0.1 against a secure file binary XML table using
    update /*+ NO_XML_DML_REWRITE */croutreach.action set object_value = :1 where actn_id = :2 .
    I am told the majority/near majority of the ~ 16 fields are updated. Also this table has numerous predefined virtual columns with fn based indexes on them.
    My first inclination was to recast this using the Oracle updatexml function. I was told, the /*+ NO_XML_DML_REWRITE */ hint would also be necessary here.
    update /*+ NO_XML_DML_REWRITE */
    <tble_name> a
    set a.object_value = updatexml(a.object_value ...).
    Last year our dba's were instructed by Oracle Support to use this hint, as the update wasn't updating any records w.o any error msgs.
    +1. Hoping to find out if anyone has run across using this hint in some capacity and what was their experience?+
    In trying to optimizie this update statement, I'll start from scratch not using the /*+ NO_XML_DML_REWRITE */ hint and will commence with using the updatexml function with setting up an xmlindex.
    +2. Hoping to receive some suggestions on creating the proper xmlindex - figuring an unstructured index. If get some good performance with the xmlindex; hoping to retire some of the virtual column usage.+
    +3. Any suggestions on living with virtual columns in conjunction with xmlindexes? See the action table definition and associated ivirtual columns and indexes. This table seems over indexed...+
    REATE
      TABLE "CROUTREACH"."ACTION" OF XMLTYPE
        CONSTRAINT "ACTN_ID_PK" PRIMARY KEY ("ACTN_ID") USING INDEX PCTFREE 10
        INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 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 "ACME_DATA" ENABLE
      XMLTYPE STORE AS SECUREFILE BINARY XML
        TABLESPACE "ACME_DATA" ENABLE STORAGE IN ROW CHUNK 8192 CACHE READS LOGGING
        NOCOMPRESS KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1
        MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
        CELL_FLASH_CACHE DEFAULT)
      ALLOW NONSCHEMA ALLOW ANYSCHEMA VIRTUAL COLUMNS
        *"ACTION_DEF_URN"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                
    /action/srvContextPointer/outreachActionDefInfo/@actionDefUrn                                              
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50))),
        *"STAT_DT"* AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
        SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                             
    /action/@status_dt'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
    WITH
      TIME ZONE))),
        *"ACT_DEF_ID"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                             
    /action/srvContextPointer/outreachActionDefInfo/@actionDefId'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(20))),
        *"CORRL_ID"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                             
    /action/correlationId'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50))),
        *"STAT_RSN"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                                 
    /action/statusReason'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(30))),
        *"ACT_APPNT_DT"* AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
        SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                 
    /action/actionAppointment/appointment_dt'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
    WITH
      TIME ZONE))),
        *"UPDT_DT"* AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
        SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                             
    /action/@update_dt'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
    WITH
      TIME ZONE))),
        *"CRET_DT"* AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
        SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                             
    /action/@create_dt'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
    WITH
      TIME ZONE))),
        *"ACT_SEQ"* AS (CAST(TO_NUMBER(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                   
    /action/srvContextPointer/outreachActionDefInfo/@sequence'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2)) AS NUMBER(10))),
        *"SERVICE_DEF_URN"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03";                                                         
    /action/srvContextPointer/serviceDefUrn'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(100))),
        *"ASSIGN_TEAM_CD"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                 
    /action/assignment/@teamCategoryCode'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50))),
        *"ASSIGN_STAFF_ID"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                 
    /action/assignment/staffProfileId'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50))),
        *"ACTION_TYPE"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)                                                     
    declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; (::)                                                     
    local-name-from-QName(QName("http://www.cigna.com/acme/domains/actions/2010/03",/action/@xsi:type))                                                                 
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50))),
        *"ACTN_ID"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03";/action/@id'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50))),
        *"STATUS"*AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03";/action/@status'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(20))),
        *"ACME_MBR_ID"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
        'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03";/action/acmeMemberId'
        PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
        16777216,0),50,1,2) AS VARCHAR2(50)))
      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 "ACME_DATA" ;
    CREATE UNIQUE INDEX *"CROUTREACH"."SYS_C0014547"* ON "CROUTREACH"."ACTION"
        "SYS_NC_OID$"
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 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 "ACME_DATA" ;
    CREATE UNIQUE INDEX *"CROUTREACH"."SYS_IL0000082156C00003$$"* ON "CROUTREACH".
      "ACTION"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 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 "ACME_DATA" PARALLEL (DEGREE 0 INSTANCES 0) ;
    CREATE UNIQUE INDEX *"CROUTREACH"."ACTN_ID_PK"* ON "CROUTREACH"."ACTION" (
      "ACTN_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 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 "ACME_DATA" ;
      CREATE
        INDEX *"CROUTREACH"."ACTION_STAT_RSN_IDX"* ON "CROUTREACH"."ACTION"
          "STAT_RSN"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 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 "ACME_DATA" ;
      CREATE
        INDEX *"CROUTREACH"."ACTION_UPDT_DT_IDX"* ON "CROUTREACH"."ACTION"
          "UPDT_DT"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 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 "ACME_DATA" ;
      CREATE
        INDEX *"CROUTREACH"."ACTION_CRET_DT_IDX"* ON "CROUTREACH"."ACTION"
          "CRET_DT"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 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 "ACME_DATA" ;
      CREATE
        INDEX *"CROUTREACH"."ACTION_STAT_DT_IDX"* ON "CROUTREACH"."ACTION"
          "STAT_DT"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 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 "ACME_DATA" ;
      CREATE
        INDEX *"CROUTREACH"."ACTION_MBRID_TYP_STAT_IDX"* ON "CROUTREACH"."ACTION"
          "ACME_MBR_ID",
          "ACTION_TYPE",
          "STATUS"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 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 "ACME_DATA" ;
      CREATE
        INDEX *"CROUTREACH"."ACT_ACTDEF_URN_IDX"* ON "CROUTREACH"."ACTION"
          "ACTION_DEF_URN"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 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 "ACME_DATA" ;
      CREATE
        INDEX *"CROUTREACH"."ACTION_ACT_DEF_ID_STATUS_IDX"* ON "CROUTREACH"."ACTION"
          "ACT_DEF_ID",
          "STATUS"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 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 "ACME_DATA" ;Any suggestions much appreciated.
    Regards,
    Richard Blanchard

    odie 63
    update /*+ NO_XML_DML_REWRITE */croutreach.action set object_value = :1 where actn_id = :2 .
    This update pattern is used in the production environment and is slowing the environment down as more xml content is increased. In a new release build, this update pattern against the action table described earlier, is particularly problematic.
    Have some more information on the /*+ NO_XML_DML_REWRITE */ hint. It turns out, last year, updates statements would intermittently fail to correctly update silently failing. An Oracle Service Request was created. Over the span of about 5 mnths, Oracle determined a very low level Oracle kernel bug was the culprit. Oracle As a result of this SR, Oracle SUpport created BUG 11939507 <ORA-08102: index key not found during update on xmltable with a virtual column>. This bug is viewable on metalink. Oracle claims this bug has only been oberved on In the interim to 11.2.0.3, Oracle Support mentioned to use /*+ NO_XML_DML_REWRITE */; thus disabling piecewise update.
    Here's preface information on this bug:
    Bug 11939507: ORA-08102: INDEX KEY NOT FOUND DURING UPDATE ON XMLTABLE WITH VIRTUAL COLUMN  
    Bug Attributes
    Type B - Defect Fixed in Product Version 12.1
    Severity 2 - Severe Loss of Service Product Version 11.2.0.1
    Status 80 - Development to Q/A Platform 23 - Oracle Solaris on SPARC (64-bit)
    Created 30-Mar-2011 Platform Version 10
    Updated 13-Feb-2012 Base Bug -
    Database Version 11.2.0.1  
    Affects Platforms Generic  
    Product Source Oracle  
    Hdr: 11939507 11.2.0.1 XDB 11.2.0.1 BINARY PRODID-5 PORTID-23
    Abstract: ORA-8102: INDEX KEY NOT FOUND DURING UPDATE ON XMLTABLE WITH VIRTUAL COLUMN*** 03/30/11 12:22 pm ***
    BUG TYPE CHOSEN  =============== code   
    Component: XML Database  ======================= 
    DETAILED PROBLEM DESCRIPTION  ============================ 
    The issue happens intermittently when running a batch program with 50  concurrent sessions that involves high concurrent updates.
    DIAGNOSTIC ANALYSIS  ===================  reproducible testcase on customer dummy data reproduced by Thomas. 
    WORKAROUND?  ===========  No   
    TECHNICAL IMPACT  ================  Customer is experiencing this error which is critical to the application  because it causes a home health care provider to possibly lose a couple  hours worth of work and have to start from scratch. The condition has only  accessed concurrently from about 40 threads  
    RELATED ISSUES (bugs, forums, RFAs)  ===================================  Bug 8514561 - ORA-8102 WHEN UPDATING TABLE
    HOW OFTEN DOES THE ISSUE REPRODUCE AT CUSTOMER SITE?  ====================================================  Intermittent  
    DOES THE ISSUE REPRODUCE INTERNALLY?  ====================================  Intermittent
    IS A TESTCASE AVAILABLE?  ========================  Yes  The good news is, this bug is corrupting a virtual index column.
    I'll try test cases using the update pattern; 'update /*+ NO_XML_DML_REWRITE */croutreach.action set object_value = :1 where actn_id = :2 ' - substituting actual values for the bind variables and removing interfering virtual columns. Wil lcompare with and w/o the hint.
    This wil address your; "Where does the new values come from? Individual variables?" - and provide sample data.
    Presently, this update pattern is used 'blindly' in that when no xml relevent changes are identified, only a couple of the roughly 16 fields are updated - yet the whole document gets updated with this update pattern. When changes occur, the whole document is updated. Will work with updating 1 or 2 fields using updatexml and try the xmlexists function for the predicate.
    04/25/12 Update:
    odie 63,
    Here's a sample xml record from the action securefile binary xml table:
    <?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?><action xsi:type="AssessmentActionType" status_dt="2012-01-18T19:38:21.077Z" status="not applicable" create_dt="2012-01-17T23:10:16.173Z" id="dfdfdfdfdfddfdfdfdfdfdf" xmlns:ns5="http://www.xxxxx.ddd/exception/definition/schema/2010/01" xmlns="http://www.xxxxxx.ddd/mmm/domains/actions/2010/03" xmlns:ns6="http://www.xxxxx.ddd/mmm/domains/utility/outcome/2010/03" xmlns:ns7="http://www.xxxxxx.ddd/mmm/domains/common/2010/03" xmlns:ns2="http://www.xxxxx.ddd/mmm/messages/actions/2010/03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://www.xxxxx.ddd/mmm/domains/workforce/2010/03" xmlns:ns4="http://www.xxxxxx.ddd/mmm/domains/entitlement/2011/11">
       <acmeMemberId>abcdefghijklmnop</acmeMemberId>
       <advocacyPlanId>qrstuvwxyz</advocacyPlanId>
       <srvContextPointer>
          <serviceDefUrn>urn:coderunner:Medical:Definition:ServiceService:11111:7</serviceDefUrn>
          <outreachActionDefInfo sequence="1" actionDefUrn="urn:xxxxxxxxxx:Medical:Definition:Action:50813:2" actionDefId="xxxxxx">
             <srvContextPath>Access Profile~Why did you access the profile?~Reason for access?</srvContextPath>
          </outreachActionDefInfo>
       </srvContextPointer>
    </action>Started out using this update statement against the virtual column a.actn_id. This column is also indexed as a fbi.
    UPDATE /*+ NO_XML_DML_REWRITE */ action A
    SET A.object_value = updatexml(A.object_value,'/action/@status','triggered','xmlns="http://www.xxxx.vvv/yyy/domains/actions/2010/03"')
    where a.actn_id='888a80be-d69f-464d-b3f7-85b6209f918e';
    This statment updates fine with and w/o the hint. This hint takes away the piecewise update of the xml document and relies upon the a.actn_id virtual column.
    Then removed the reliance on the virtual column using the xmlexists fn.
    First did an alter index 'actn_id_pk invisible' to take the virtual column out of consideration by the optimizer.
    UPDATE /*+ NO_XML_DML_REWRITE */ action A
    SET A.object_value = updatexml(A.object_value,'/action/@status','triggered','xmlns="http://www.xxxx.vvv/yyy/domains/actions/2010/03"')
    where xmlexists('$p/action[@id="'888a80be-d69f-464d-b3f7-85b6209f918e'"]' PASSING object_value as "p");
    This update runs but doesn't update any columns - with or without the hint.
    Also created a basic unstructured xmlindex to remove the full table scan - which worked fine execution plan-wise.
    create index action_xmlindex_ix on action (object_value) indextype is xdb.xmlindex;Per the SR on this, the /*+ NO_XML_DML_REWRITE */ disables piecewise update and is a workaround for the bug surrounding virtual column index usage when having many concurrent sessions and updates against a table with millions of xml documents. Getting rid of the virtual column in the predicate removes the need for the workaround hint.
    My problem is This update runs but doesn't update any columns. Maybe am missing something or doing a syntax/semantic error ?
    Any assistance much appreciated...
    Regards,
    Rick Blanchard
    Edited by: RickBlanchardSRSCigna on Apr 25, 2012 12:52 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem in UPDATE with EXTRACTVALUE : ORA-00600

    Hi all,
    I have some trouble with this update query :
    UPDATE enveloppe_message
       SET ems_date_modification = SYSDATE,
           ems_login_modification = 'pipo',
           ems_dn_emet = EXTRACTVALUE (ems_xml, '/DataPDU/Header/Message/Sender/DN', 'xmlns="urn:swift:saa:xsd:saa.2.0"'),
           ems_dn_dest = EXTRACTVALUE (ems_xml, '/DataPDU/Header/Message/Receiver/DN', 'xmlns="urn:swift:saa:xsd:saa.2.0"'),
           ems_reference_tech = EXTRACTVALUE (ems_xml, '/DataPDU/Header/Message/SenderReference', 'xmlns="urn:swift:saa:xsd:saa.2.0"')
    WHERE ems_id = 1130;I get this error message :
    ORA-00600: code d'erreur interne, arguments : [koklismem111: BFILE locator], [], [], [], [], [], [], [], [], [], [], []But if I do this :
    SELECT EXTRACTVALUE (ems_xml, '/DataPDU/Header/Message/Sender/DN', 'xmlns="urn:swift:saa:xsd:saa.2.0"') AS a,
           EXTRACTVALUE (ems_xml, '/DataPDU/Header/Message/Receiver/DN', 'xmlns="urn:swift:saa:xsd:saa.2.0"') AS b,
           EXTRACTVALUE (ems_xml, '/DataPDU/Header/Message/SenderReference', 'xmlns="urn:swift:saa:xsd:saa.2.0"') AS c
      FROM enveloppe_message
    WHERE ems_id = 1130;It's ok and I get these datas :
    a : ou=abc,ou=ghf,o=bvhdjdie,o=lkljg
    b : ou=dfg,ou=fkd,o=nbjfkkdk,o=bnfjd
    c : jkldfjsdlflsnvkllkfkfllcklqsjkckldand thus, this query become ok ????
    UPDATE enveloppe_message
       SET ems_date_modification = SYSDATE,
           ems_login_modification = 'pipo',
           ems_dn_emet = 'ou=abc,ou=ghf,o=bvhdjdie,o=lkljg',
           ems_dn_dest = 'ou=dfg,ou=fkd,o=nbjfkkdk,o=bnfjd',
           ems_reference_tech = 'jkldfjsdlflsnvkllkfkfllcklqsjkckld'
    WHERE ems_id = 1130;Does anyone have some idea ????
    Thanks.

    Thanks a lot Marco for the link on the FAQ.
    But I don't understand how to use a non default namespace... sorry!
    Finally, this query is okay :
    SELECT xmlcast(xmlquery('declare default element namespace "urn:swift:saa:xsd:saa.2.0"; $p/DataPDU/Header/Message/Sender/DN' passing ems_xml as "p" returning content) as varchar2(4000)) AS a,
           xmlcast(xmlquery('declare default element namespace "urn:swift:saa:xsd:saa.2.0"; $p/DataPDU/Header/Message/Receiver/DN' passing ems_xml as "p" returning content) as varchar2(4000)) AS b,
           xmlcast(xmlquery('declare default element namespace "urn:swift:saa:xsd:saa.2.0"; $p/DataPDU/Header/Message/SenderReference' passing ems_xml as "p" returning content) as varchar2(4000)) AS c
      FROM enveloppe_message
    WHERE ems_id = 1130;But this one, not !
    UPDATE enveloppe_message
       SET ems_date_modification = SYSDATE,
           ems_login_modification = 'pipo',
           ems_dn_emet = xmlcast(xmlquery('declare default element namespace "urn:swift:saa:xsd:saa.2.0"; $p/DataPDU/Header/Message/Sender/DN' passing ems_xml as "p" returning content) as varchar2(4000)),
           ems_dn_dest = xmlcast(xmlquery('declare default element namespace "urn:swift:saa:xsd:saa.2.0"; $p/DataPDU/Header/Message/Receiver/DN' passing ems_xml as "p" returning content) as varchar2(4000)),
           ems_reference_tech = xmlcast(xmlquery('declare default element namespace "urn:swift:saa:xsd:saa.2.0"; $p/DataPDU/Header/Message/SenderReference' passing ems_xml as "p" returning content) as varchar2(4000))
    WHERE ems_id = 1130;I get the same error :
    ORA-00600: code d'erreur interne, arguments : [koklismem2: insufficient locator len], [0], [86], [], [], [], [], [], [], [], [], []Maybe these optimizations don't solve my initial problem !?

  • Problem with update form and date (show 1970-01-01)

    Hi, I've a update form (php/mysql) with many date input field. When my date is 000-00-00 I show 1970-01-01. Why??
    This is the code:
    label for="data_chiusura"><strong>Data chiusura</strong></label>
          <input type="text" name="Data_chiusura" value="<?php echo $string=$row_Recordset1['data_chiusura'];
        if($string == '0000-00-00'){
        $string = '';
        } else {
        $string = date("d-m-Y", strtotime($string));
        }; ?>" id="Data_chiusura">
    Thanks
    k

    Why would the date ever be null? As long as the date has a non-zero, non-null value this function will work correctly.
    I'm a little confused by what you are doing here. So, you are pulling data from a table, and populating forms with it. This particular field is a date field, and the problem is that when the data for that field is a null, you are getting instead a date of 1970-01-01 displayed in that field - is that correct? What do you want to appear there when the data is null? Nothing?

Maybe you are looking for

  • SSRS Dataset Column MetaData dynamic Update

    Hi All, I  have report which is dynamically pivoting columns    in the query ,i need to update those dynamic  columns on the ssrs    column metadata fields on the data set,cross tabbing using tablix doesn't work for my logic  ,is there any way ,the  

  • Need document viewer in sharepoint 2013

    Hi, I need document viewer for documents in library and need to place annotations. Thanks & Regards, Siva

  • Fonts not appearing in Classic

    When I open up a program in Classic, only a few fonts appear. I have my fonts in the fonts folder in System 9. Help!

  • ITunes Match - who keeps originals?

    If I subscribe iTunes Match, do I keep originals of my songs in my imac, or they will be deleted from it and moved to cloud?

  • Firmware Update 5.1.5f2 Won't Go

    I'm trying to update my firmware, and from the instructions it says to hold down the Power button until the light flashes or until one hears a long tone. I hold down the Power button, and neither happens, but I do get dumped into Open Firmware, which