Why Update query is executing twice in this case even if called one time?

Example 1=>
I have unix ksh file and I am calling sql file from it.
(table 1 contains 2 rows -
ID      Name
1 test't
2 Pet's
below sql statement is part of sql file:
update table1 set name = replace(name,'''','''''') where instr(name,'''') > 0 ;
2 rows updated.
2 rows updated.
--after this update I see name is updated to test''''t and pet''''s
(Problem here is I see 2 rows updated two times.even if there is one row its getting updated two times)
Example 2)
SO I have created other ksh and sql and in that sql I have written same update and its working fine.
update table1 set name = replace(name,'''','''''') where instr(name,'''') > 0 ;
2 rows updated.
--after this update I see name is updated to test''t and pet''s
Why there are 2 updates in first example?

Please always provide the required information (as said in the forum's stickies): at least sqldev, OS, JDK and DB versions.
Regards,
K.

Similar Messages

  • On Execute operation, the bean getter is being called multiple times

    Hi,
    I have a JCR data control, i am trying to write a method that returns predicate, but this method is being called multiple times, when executing the advanced search operation.
      public List<Predicate> getPredicates() {
      ArrayList<Predicate> predicates = new ArrayList<Predicate>();
       // predicates.add(new Predicate("jcr:content/idc:metadata/idc:xScope",Operator.EQUALS,"GLOBAL"));
      DCBindingContainer bc=(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
      JUCtrlListBinding attrBinding=(JUCtrlListBinding)  bc.findCtrlBinding("StateId");
      Object stateId= attrBinding.getSelectedValue();
      if(stateId instanceof Row){
      predicates.add(new Predicate("jcr:content/idc:metadata/idc:xState"
      , Operator.EQUALS
      ,((Row)stateId).getAttribute("StateId").toString()));
      attrBinding=(JUCtrlListBinding)  bc.findCtrlBinding("DistrictId");
      Object districtId=attrBinding.getSelectedValue();
      if(districtId instanceof Row){
          predicates.add(new Predicate("jcr:content/idc:metadata/idc:xDistrict",Operator.EQUALS,((Row)districtId).getAttribute("DistrictId").toString()));
        attrBinding=(JUCtrlListBinding)  bc.findCtrlBinding("Scope");
        Object scopeId=attrBinding.getSelectedValue();
        if(scopeId instanceof Row){
            predicates.add(new Predicate("jcr:content/idc:metadata/idc:xScope",Operator.EQUALS,((Row)scopeId).getAttribute("ScopeType")));
        AttributeBinding tempAttrBinding=(AttributeBinding)bc.findCtrlBinding("CreatedDate");
        Object createdDate=tempAttrBinding.getInputValue();
        if(createdDate!=null){
            predicates.add(new Predicate("jcr:content/jcr:created",Operator.EQUALS,createdDate.toString()));
        if (predicates.size()>0){
          return predicates;
      return Collections.emptyList();
      } The problem is while it's being called multiple times different list's are being returned which is causing the method not to work . The bean is in pageFlowScope .

    That is bc ADF life cicle... Is always executing 2 times...

  • I need a data transfer from intact hard drive of older macbook that won't boot. Can Apple provide this service even though my one to one membership has expired?

    I need a data transfer from a 2005 Macbook to my new one (2010). I damaged the old laptop and although it wouldn't turn on, when I brought it to the Apple Store they ascertained that the hard drive was still intact. They said I needed to purchase a one to one membership to get a data transfer, which I did, but somehow forgot about it and now it's expired. Is there any way I can still get the data from the old hard drive transferred to my new macbook? Can Apple provide this service even though my one to one membership has expired?

    Go to OWC where you can purchase a suitable enclosure for the drive. You will need an enclosure for a SATA notebook drive. This is assuming the old computer is a MacBook and not an iBook. I make this observation because the first MacBook was released in 2006, not in 2005. If yours is a 2005 model then it's an iBook and uses an ATA interface.
    Install the old drive in the enclosure, connect to your new computer. You can then transfer your data.

  • Why update query takes  long time ?

    Hello everyone;
    My update query takes long time.  In  emp  ( self testing) just  having 2 records.
    when i issue update query , it takes long time;
    SQL> select  *  from  emp;
      EID  ENAME     EQUAL     ESALARY     ECITY    EPERK       ECONTACT_NO
          2   rose              mca                  22000   calacutta                   9999999999
          1   sona             msc                  17280    pune                          9999999999
    Elapsed: 00:00:00.05
    SQL> update emp set esalary=12000 where eid='1';
    update emp set esalary=12000 where eid='1'
    * ERROR at line 1:
    ORA-01013: user requested cancel of current operation
    Elapsed: 00:01:11.72
    SQL> update emp set esalary=15000;
    update emp set esalary=15000
      * ERROR at line 1:
    ORA-01013: user requested cancel of current operation
    Elapsed: 00:02:22.27

    Hi  BCV;
    Thanks for your reply but it doesn't provide output,  please  see   this.
    SQL> update emp set esalary=15000;
    ........... Lock already occured.
    >> trying to trace  >>
    SQL> select HOLDING_SESSION from dba_blockers;
    HOLDING_SESSION
                144
    SQL> select sid , username, event from v$session where username='HR';
    SID USERNAME     EVENT
       144   HR    SQL*Net message from client
       151   HR    enq: TX - row lock contention
       159   HR    SQL*Net message from client
    >> It  does n 't  provide  clear output about  transaction lock >>
    SQL> SELECT username, v$lock.SID, TRUNC (id1 / POWER (2, 16)) rbs,
      2  BITAND (id1, TO_NUMBER ('ffff', 'xxxx')) + 0 slot, id2 seq, lmode,
      3  request
      4  FROM v$lock, v$session
      5  WHERE v$lock.TYPE = 'TX'
      6  AND v$lock.SID = v$session.SID
      7  AND v$session.username = USER;
      no rows selected
    SQL> select MACHINE from v$session where sid = :sid;
    SP2-0552: Bind variable "SID" not declared.

  • Hints why all Update Routines are coming with 0.00. Even the simple ones?

    Hi,
    any hints why about 5 update routines that I have written are coming with 0.00 or blanks.
    Even very simple ones such as the one for MyCclQTY in the cube, which has the only line in the update routine between ODS and Cube:
    RESULT = SOURCE_FIELDS-QTY.
    shows in the cube output as blanks while QTY has data:
    e.g. of Cube Output:
    QTY-Field2-MyCclQTY----MyCalField2
    300--125--BLANK--
    0.00
    600--42.9-BLANK--
    0.00
    Basically all my routines, e.g. MyCclQTY, MyCalField2
    are not showing values while the direct mappings show the correct data.
    In the above simple case, with the routine shown above, I expected to see 300 and 600 for MyCclQTY but they come out blank.
    Any hints as to what may be wrong?
    Thanks

    <Font Face="Tahoma" Color="Blue">
    Dear Friend,
    Can you please try
          RESULT = COMM_STRUCTURE-Qty.
    Also please check that you have assigned correct Unit of Measure in the field "Unit of Routine".
    Hope it helps.
    Regards,
    Abhijit
    </Font>
    Edited by: Siegfried Szameitat on Nov 3, 2008 12:23 PM
    deleted request for points. it is against the rules.

  • Why does my MacBook start typing in upper case even though Caps lock is off?

    On occasions, when typing, my MacBook starts to type in upper case even though the Caps lock is off? This is not a physical sticking of the shift key as it happens even when using a USB keyboard? I have to use the shift key kind of in reverse to revert to lowercase entry.
    I have checked settings and I cannot find anything that could be causing it.
    Really bloody annoying!
    Can anybody help.
    I have a two week old MBP w Retina Display. This did happen on my old MBP and I did restore this new MBP from my Time Capsule disk so assume I brought the problem with me so to speak.

    Do you have "sticky keys" turned on under Accessibility by accident?

  • Complex update query noy executing

    i am writing this SQL getting error in this not understanding why
    SQL
    update ivpodtl set pendingqty =(pendingqty-10)
    ,*Packedpendingqty* =(Packedpendingqty-10)
    where ivpodtl.id=1;
    ivpodtl - table name
    pendingqty - column name
    Packedpendingqty - column name
    ERROR
    Error report:
    SQL Error: ORA-00933: SQL command not properly ended
    00933. 00000 - "SQL command not properly ended"
    *Cause:   
    *Action:
    please give some suggestions
    Edited by: user21354 on Mar 31, 2011 11:59 PM
    Edited by: user21354 on Apr 1, 2011 12:00 AM

    Note that the semicolon is not part of your update statement and is often (ab)used as a run-character in SQL*Plus. My guess is that you are executing this update statement in some other environment where that semicolon is meaningless and should be removed.
    Regards,
    Rob.

  • I have updated to version 6 twice, I am using Windows XP, yet every time it states I am not updated, my browser looks like the old one? How can I get this fixed to look like the new browser version?

    I still have all the menu options at top... (ex:File, Edit, View...ect) Looks like old version, Under Help it says version 6, yet when I open it, it states I am not updated..
    I would like to get the new version, please help! Thanks, Kristal

    are you doing the update with admin privileges?
    has caused quiet update failures for me in the past...

  • What query should be created for this case

    Here are those classes:
    Folder{
        String name;
        @ManyToOne
        Subject owner;
    Subject {
        String name;
    }What query should I create in order to: find out if there is an actual Folder for a Subject with the name X in the database ?
    Actually, the question is kinda stupid, but im not experienced with queries....

    javaUserMuser wrote:
    Here are those classes:
    Folder{
    String name;
    @ManyToOne
    Subject owner;
    Subject {
    String name;
    }What query should I create in order to: find out if there is an actual Folder for a Subject with the name X in the database ?Can't tell based on the info you posted. These are Java objects, and queries deal with relational tables.
    Your naming is confusing. Subject and owner are two very different things.
    If I had two tables like this:
    CREATE TABLE IF NOT EXISTS owners
        owner_id bigint not null auto_increment,
        name varchar(80),
        primary key(owner_id)
    CREATE TABLE IF NOT EXISTS folders
        folder_id bigint not null auto_increment,
        name varchar(80),
        owner_id bigint   
        primary key(folder_id),
        foreign key(owner_id) references(owners)
    );I'd write the JOIN query this way:
    SELECT f.name, o.name
    FROM folders as f, owners as o
    WHERE o.owner_id = ?
    AND o.owner_id = f.owner_idYou realize, of course, that if you're using EJB3 as the annotations suggest, that you don't write any SQL. EJB3 generates it dynamically for you.
    %

  • TS1389 Hi Since the last Apple update, every timr i open itunes I get the Welcome page and have to agree to share my libaray. before the update I only had to do this once. Now its every time. Any solutions?

    HI Since the last Apple itune WIndows update every time i open itunes I get the Welcome page and have to agree to share my library. Before the update i had only done this once. Now its every timre i open itunes

    Copied from your previous post.
    You are right the Iphone is locked into the carrier softbank from Japan and its not the 3g model its the one before it, I am not sure what model.
    If your iPhone is not the 3G model - it is the one before that, this means your iPhone is the first generation iPhone or the original iPhone, which WAS NOT sold officially by Apple in Japan. The first generation iPhone was sold officially by Apple in the U.S. as carrier locked with AT&T, in the UK as carrier locked with O2, in Germany as carrier locked with T-Mobile, and in France as carrier locked with Orange and as officially unlocked by Orange. The ONLY country where the first generation was sold as officially unlocked was in France, which is required by French law.
    The original iPhone - the one before the 3G was not sold by Apple in Japan directly or through Softbank.
    Did you purchase your iPhone from Softbank or from an Apple store in Japan ? If so, this would also mean your iPhone is carrier locked with Softbank since the iPhone is sold in Japan officially as carrier locked with Softbank only, and this would be the 3G or 3GS, not the original iPhone. This would also mean you are roaming internationally with Softbank with your iPhone in China. If you are using a SIM card from a carrier in China with your iPhone, your iPhone has been hacked to be unlocked unless you purchased your iPhone from an unofficial source in Japan which was sold originally as new officially in France as officially unlocked by the carrier Orange in France.
    Is your iPhone is carrier locked with Softbank in Japan, are you paying Softbank international roaming fees while using your iPhone in China?

  • Why can't I open up Firefox 4.0 Beta again? One time only?

    Yesterday I downloaded a preview of Firefox 4.0 Beta 1 and had a blast playing with it but this morning I went to try it out again and now its just back to normal Firefox 3.6. I double-clicked the new 4.0 icon in multiple places, (i.e. Start Menu, Desktop) and still nothing just regular ol' Firefox 3.6.
    == This happened ==
    Every time Firefox opened
    == I went to reopen Firefox this morning

    I was running 3.6.6 on my XP computer and I can run both 4.0b and 3.6.6 just fine.
    If you go to C:\Program Files you will probably notice that there is a Mozilla Firefox folder and a Mozilla Firefox 4.0 Beta 1 folder. Make sure you have closed whatever Firefox window you have open and then open the firefox.exe from the Mozilla Firefox 4.0 Beta 1 folder.
    The executable files for the two versions of Firefox are different, so you have to make sure your shortcuts are aimed at the right one.

  • Why I can't switch on more than three add-ons in one time?

    One day when I lanched Firefox, I saw that some add-ons are diseabled. I tried to enable it, but after Firefox restart it's still as it was. Please help!

    It is possible that there is a problem with the file(s) that store the extensions registry.
    Delete the extensions.* files (e.g. extensions.json, extensions.sqlite, extensions.ini) and compatibility.ini in the Firefox profile folder to reset the extensions registry.
    *https://support.mozilla.org/kb/Profiles
    New files will be created when required.
    See "Corrupt extension files":
    *http://kb.mozillazine.org/Unable_to_install_themes_or_extensions
    *https://support.mozilla.org/kb/Unable+to+install+add-ons
    If you see disabled or not compatible extensions in "Firefox/Tools > Add-ons > Extensions" then click the Tools button at the left end of the Search bar to check if there is a compatibility update available.
    You can check for problems with preferences.
    Delete possible user.js and numbered prefs-##.js files and rename (or delete) the prefs.js file to reset all prefs to the default value including prefs set via user.js and prefs that are no longer supported in the current Firefox release.
    *http://kb.mozillazine.org/Preferences_not_saved
    *http://kb.mozillazine.org/Resetting_preferences

  • UPDATE QUERY can't update table

    Hi,
    During 1500-2000 concurrent users, DB Transaction locks occur. So that Update query can't update table and we get inconsistent data. How can we avoid this inconsistent data?? Why we get transaction locks??
    Eg. In update query it update the status of user with completed; but because of transaction lock  update query can't update status of user it remains uncompleted. So we can get wrong status of user(inconsistent data). Why UPDATE query update the status
    of user???
    update table set status='completed', date=@p2,score=@p3 where id=@p1

    You are not getting inconsistent data, you are getting the data according to the isolation level you are running under. The isolation level determines the locking model and therefore determines any bad dependencies you may experience. Reducing the bad dependencies
    through higher isolation level will lower concurrency. *This* is the core concept of Transactional Processing theory.
    Furthermore there is not really such a thing as a DB Transaction lock - at least not in the way you mean. SQL server does use DB locks (such as Shared transaction workspace and Exclusive transaction workspace) but the highest level of lock escalation is
    the object level (heap or btree) so those are the things you are really interested in. In the ideal would you want all Exclusive, Shared and U locks to be taken at the RID (heaps) or Key (cluster tables) level - and only have few of them per query.
    In conclusion think carefully about your query and how it is implimented under the covers by the database engine.
    Regards,
    Mark Broadbent.
    Microsoft Certified Master
    Contact me through twitter |
    blog | sqlcloud
    Please click "Propose as answer" if a post solves your problem
    or/and vote the post up if it's been helpful.

  • Not comitting database after the update query in jdbc

    Hi all,
    This is the first time I am posting this. I have query excuting on racle DB. This is update query. after executing the i have called commint using con.commit(). But still it is not showing the modifications in oracle db.
    What could be went wrong? Any sugestion, please let me know. I think it is simple jdbc program. So i don't think i need to post the code. Application running in Unix machine.
    Regards & thanks,
    Nirmala Vijaya Sekhar Varre

    VijayTechM wrote:
    Connection con = null;
    Class.forName("oracle.jdbc.driver.OracleDriver");          
    hi all,
    // following is the code
    con = DriverManager.getConnection("jdbc:oracle:thin:@10.129.239.43:1529:PBILLING","BILLING","BILLING");
    boolean test = con.getAutoCommit(); //here I am getting 'true'
    String invoice_header_query = "update invoice_header set file_traffico = '" + zipFileName + "' where bill_ref_no = '" + billRefNo_ + "' and bill_ref_resets = '" + billRefResets_ + "' and arbor_instance_id = '" + arborID_ + "'";
    System.out.println("invoice_header_query---->"+invoice_header_query);
    smt = con.createStatement();
    int x = stmt.executeUpdate(query); // Here x = 1 printing so it is updating the one record
    // con.commit(); // Even I have tried call this method. But this will be useful when you are using the Transactioon.
    Could you please tell me what went write. I am using ojdbc14.jar.
    regards,
    VijayPost with code tags and where is your claimed exception handling?

  • Why update with subqueries does not have cost and cardinality?

    There is update.
    update test t1 set dummy = (select dummy from test2 t2 where t1.id = t2.id);Both tables which have actual statistics. Each has 1000 rows. And column ID have values from 1 to 1000 in each table.
    This is explain plan
    | Id  | Operation          | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT   |       |  1000 | 13000 |   426   (9)| 00:00:01 |
    |   1 |  UPDATE            | TEST  |       |       |            |          |
    |   2 |   TABLE ACCESS FULL| TEST  |  1000 | 13000 |   426   (9)| 00:00:01 |
    |*  3 |   TABLE ACCESS FULL| TEST2 |     1 |    13 |   426   (9)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - filter("T2"."ID"=:B1)We can see here, that Oracle consider subquery within update as once-executed subquery.
    This is runtime plan
    | Id  | Operation          | Name  | Starts | E-Rows | A-Rows |
    |   1 |  UPDATE            | TEST  |      1 |        |      0 |
    |   2 |   TABLE ACCESS FULL| TEST  |      1 |   1000 |   1000 |
    |*  3 |   TABLE ACCESS FULL| TEST2 |   1000 |      1 |   1000 |
    Predicate Information (identified by operation id):
       3 - filter("T2"."ID"=:B1)Why first plan does not have cost in step 1?
    Does Oracle always not understand that update with subqueries will performed as NL or filter? In other words that step 3 will executed many times.
    Or it is my bug (or what?)?

    793769 wrote:
    Does Oracle always not understand that update with subqueries will performed as NL or filter? In other words that step 3 will executed many times.
    Or it is my bug (or what?)?It's not possible to say whether this is a bug or a deliberate choice.
    Because of "subquery caching" (see http://jonathanlewis.wordpress.com/2006/11/06/filter-subqueries/ ) the optimizer cannot predict how often the subquery will have to run. So possibly it shows nothing rather than showing the best or worst cases or a pure guess.
    Regards
    Jonathan Lewis

Maybe you are looking for

  • I Have found a bug in iOS 7.1 on iPhone 4S ? What should i do ?(i'm french)

    I Have found a bug in iOS 7.1 on iPhone 4S, what shoud I Do ? (i'm french)

  • XML insert problem

    Hi, I am trying to insert an xml ducument into table. But because of quotation i the file is not getting inserted. here is the Insert statement INSERT INTO MYTABLE3 VALUES(' <catalog>      <book > <author>Gambardella, Matthew</author> <title>XML Deve

  • Storage Space Setup Hardware Requirement

    Hi,  Currently I am testing the Storage Space on Windows 2012 R2 on Supermicro X7DBE+ server. The server has 8 Bays and I am testing it with only 3 320GB HDD (all internal). From the HDD bay, it connected to PCI-e RAID controller that is not supporte

  • STO delivery date and VL10B delivery

    I'm trying to run VL10B to create a delivery for a STO item that is in stock, but no  delivery is created. The STO item, however, has a delivery date prior to the current date.  If I change this delivery date on the STO to a future date, the VL10B th

  • Global Selector .AFFieldTextDisabled does not work

    The declaration of styles against the global selector .AFFieldTextDisabled do not effect disabled input text components as is implied in the Selectors for Skinning ADF Faces Components document. Can anyone please clarify if I am using this selector i