Problem in getting update records count while executeBatch()

hi,
I have used "Select in Insert" queries for migrating data from one table to another.
like
INSERT INTO TABLE1 (COL1, COL2)
SELECT COL1,COL2,... FROM TABLE2
WHERE COL1 = ... AND COL2 = ...;
Case 1:
I added these statements as addBatch() & at the end i execute method " executeBatch()". It returned the array of integer having record count for each query respectively.
But that count was always be -2 i.e. SUCCESS_NO_INFO.
Case 2:
If i run the same code with executeUpdate() method , it returned me the correct number of records counts that are inserted into the table.
I cudn't able to understand that it is failing for case1.
Can anybody tell the reason for this behaviour .......................
Edited by: user11187328 on Mar 17, 2010 3:45 AM
Edited by: user11187328 on Mar 17, 2010 3:46 AM

hi,
Thanks again for a correct reply but can u also tell me tht which jar i needs to included.
There are so many jar files & should i remove old jar files or jvm auto picks the updated jar file.
Following jar files are shown on the link:::
ojdbc5.jar (1,996,228 bytes) - Classes for use with JDK 1.5. It contains the JDBC driver classes, except classes for NLS support in Oracle Object and Collection types.
ojdbc5_g.jar (3,081,328 bytes) - Same as ojdbc5.jar, except that classes were compiled with "javac -g" and contain tracing code.
ojdbc6.jar (2,111,220 bytes) - Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.
ojdbc6_g.jar (3,401,519 bytes) - Same as ojdbc6.jar except compiled with "javac -g" and contains tracing code.
ojdbc5dms.jar (2,429,777 bytes) - Same as ojdbc5.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
ojdbc5dms_g.jar (3,101,875 bytes) - Same as ojdbc5_g.jar, except that it contains instrumentation to support DMS.
ojdbc6dms.jar (2,655,741 bytes) - Same as ojdbc6.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
ojdbc6dms_g.jar (3,423,263 bytes) - Same as ojdbc6_g.jar except that it contains instrumentation to support DMS.
orai18n.jar (1,656,280 bytes) - NLS classes for use with JDK 1.5, and 1.6. It contains classes for NLS support in Oracle Object and Collection types. This jar file replaces the old nls_charset jar/zip files.
demo.zip (603,363 bytes) - contains sample JDBC programs.

Similar Messages

  • Problem in getting correct update records count while getUpdateCount()

    hi,
    I have used "Select in Insert" queries for migrating data from one table to another.
    like
    INSERT INTO TABLE1 (COL1, COL2)
    SELECT COL1,COL2,... FROM TABLE2
    WHERE COL1 = ... AND COL2 = ...;
    Case 1:
    I added these statements as addBatch() & at the end i execute method " executeBatch()".
    Then i execute
    getUpdateCount() method
    on that prepareStatement ,but that count was not correct all the time.
    Case 2:
    If i run the same code with executeUpdate() method , it returned me the correct number of records counts that are inserted into the table.
    I cudn't able to understand that it is failing for case1.
    Can anybody tell the reason for this behaviour .......................
    Edited by: user11187328 on Mar 18, 2010 4:52 AM

    hi,
    Thanks again for a correct reply but can u also tell me tht which jar i needs to included.
    There are so many jar files & should i remove old jar files or jvm auto picks the updated jar file.
    Following jar files are shown on the link:::
    ojdbc5.jar (1,996,228 bytes) - Classes for use with JDK 1.5. It contains the JDBC driver classes, except classes for NLS support in Oracle Object and Collection types.
    ojdbc5_g.jar (3,081,328 bytes) - Same as ojdbc5.jar, except that classes were compiled with "javac -g" and contain tracing code.
    ojdbc6.jar (2,111,220 bytes) - Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.
    ojdbc6_g.jar (3,401,519 bytes) - Same as ojdbc6.jar except compiled with "javac -g" and contains tracing code.
    ojdbc5dms.jar (2,429,777 bytes) - Same as ojdbc5.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc5dms_g.jar (3,101,875 bytes) - Same as ojdbc5_g.jar, except that it contains instrumentation to support DMS.
    ojdbc6dms.jar (2,655,741 bytes) - Same as ojdbc6.jar, except that it contains instrumentation to support DMS and limited java.util.logging calls.
    ojdbc6dms_g.jar (3,423,263 bytes) - Same as ojdbc6_g.jar except that it contains instrumentation to support DMS.
    orai18n.jar (1,656,280 bytes) - NLS classes for use with JDK 1.5, and 1.6. It contains classes for NLS support in Oracle Object and Collection types. This jar file replaces the old nls_charset jar/zip files.
    demo.zip (603,363 bytes) - contains sample JDBC programs.

  • How to get the record count printed for the report in the Dashboards

    Hi,
    I would like to get the record count printed at the bottom of every dashboard report like:
    < 1 - 25 of 6300 > instead of < 1 - 25 >
    Any help is appreciated
    Regards
    B

    I have tried the following formula which identifies the lowest grain but it does not seem to give me correct result.. I am not getting the correct count. I am getting as 3.A work order can be updated only once at one point of time.hence the formula
    MAX(RCOUNT(CAST("SR Wo Fact"."Crm Wo Number" AS CHAR) ||CAST("SR Wo Fact"."PSC Timestamp" as char)))
    I tried only MAX(RCOUNT(1)), but I was able to get the record count as corect for Administrator but not for other users.
    Has anyone come across this scenario.
    Thanks Shravan
    Edited by: 786443 on Aug 19, 2010 10:22 AM

  • Get the record count from a query

    Hi,
    does anyone know how to get the record count from a sql query?
    e.g: I've got a ResultSet from the Statement.excuteQuery(), and I want to know how many records this ResultSet contains, how to get this?
    I'd read thoughout the documents of Statement and ResultSet, but couldn't find a solution, do I have to use another seperate query such as "select count(*)" to do this?
    thanks.
    Yang Liu

    If you are not using a scrollable result set then the following is the best way to do it.
    there are several key words in SQL that can be used, the one you are interested in is count();
    so if your query at the moment is
    "select col1, col2, col3 from my_table where col2=? and col3=?"you can work out how many rows will be returned by executing this command first
    "select count(col1) from my_table where col2=? and col3=?"this will return a result set with one row and one column, you can get the row count as follows:
    ResultSet rs = ps.executeQuery();
    int rowCount = rs.getInt(1);I hope this helps :)

  • Getting the record count from result set

    i'm retreiving the result set using the executeQuery method, now i want to know how many records are there in the result set, that is the record count of the result set.
    one solution to that is to first use the executeUpdate and then use the executeQuery but i think that is not the right way.
    so please tell me is there any method in jdbc to get that thing done
    Tanx

    Hi
    Do you know if your DB supports "insensitive scrolling"?
    SQL generally do, but some don't - I had the same problem with the
    open source version of Interbase from Phoenix...
    Anyway - try creating your statement this way:
    public Statement createStatement(int resultSetType, int resultSetConcurrency)
    throws SQLException
    ...where resultset type should be:
    ResultSet.TYPE_SCROLL_INSENSITIVE
    Then you can do this:
    ResultSet rs = stm.executeQuery(q);
    int size = rs.last(); //this what you looking for?
    rs.beforeFirst();
    while(rs.next()){
    }

  • Field not getting updated in BDC while running in background

    Hi Friends,
    I'm executing a BDC transaction to update the Alternate Tax Classification (VBAK_TAXK1) field in Sales Order. I'm passing value 1 to the field and then saving it directly. While running the BDC in background, the field is not getting updated. On the other hand i checked it running in foreground, the field got updated without any error message.
    Can anybody help me advicing why the field is not getting updated in background?
    Thanks,
    Bestin

    Hi ,
    Check the the log if you are using a session method and if call transaction then capture the messages for the same,
    Because in the foreground the BDC will update the records even if there is a warning message nut in background it will not update. So check the data which you are inserting and try avoid the warning messages also so that it can run smoothly in backfround.
    Thanks & Regards
    Jyo

  • How to get updated by count value in database ?

    hi all,
    I created jsp page iin which insert,update,delete , query and queryall Functionalities are working...
    I need following,
    whenever i update a record i should get updated by, updated time and updated count.. to be stored in database...
    i achieved to store updated by and updated time...
    please help me how to get updated count:
    when ever a record is updated for first time updated count=1,
    for second time it should be 2 for third time it should be 3 and so onnnn
    please help me how to write this kind of function and kind of code help will be appriciated....

    if you want "number of updates" performed on each row to be persistive, you should have designed the schema with an extra field which keeps number of updates performed.
    to generic solution sql statement should have been written like
    INSERT INTO table (a,b,c,update_count) VALUES (1,2,3,4)
      ON DUPLICATE KEY UPDATE update_count=update_count+1;in this case even a insert statement will work, you wouldn't had to write another update statement.
    or if u want to use update statement only
    have an extra column "update_count" do "update_count=update_count+1" on each update statement, set initial default value to 0;
    and if u want to know how many rows have been updated
    as BalusC wrote
    BalusC wrote:
    PreparedStatement#executeUpdate() returns an int which represents the amount of affected rows.

  • Get estimated record count

    for pagination, we want to show the total pages. the way is to get the total count,then divided by the record number per page. The problem is its too expensive to get the total count.
    In pl/sql, we can get the estimated record count with
    select * from table(dbms_xplan.display_cursor(null,null,'ALLSTATS LAST')); but my question is how to get this number from application code, like java or php.
    Thanks,

    Hi,
    Though what you're trying to do can be achieved in three steps *(i)* importing of java.io.* and java.sql.* packages *(ii)* establishment of a connection using JDBC driver, and *(iii)* query execution, it would NOT be constructive for the fact that a SELECT statement (as stated in the above reply) will always be a part of the query sentence for the following reasons:
    (a) When objects are executed in Java, the first statement that is compiled is a SQL statement.
    (b) Parameters cannot be defined in SQL strings.
    Hence, as per my understanding, you can either stick to the existing approach or modify it as per the defined standards and not customized ones.
    Regards,
    Naveed.

  • Problem in getting Updated EJB methods in JSC for a Same Project

    I'm Using Sun Studio Enterprise for developing EJB sets.After that i'm importing the EJB set in to JSC & using it my Project.
    If i need to add some more business methods/edit the business method i'm able to do that in the Sun Enterprise IDE.After editing the EJB ,redeploying & reimporting to JSC i couldn't get the updated version of EJB in my Current Project.
    We could be able to get the updated EJBs,if we are using it in a new project other than using it in the Previous one.
    It's being a great problem for me.Vat shall i do for this problem?Please help me,a project is in Pending stage because of this problem.
    Regards
    Kajanan

    Hi MWH@Keystroke,
    Thanks for your consideration of my problem.I also use an EJB layer built in Sun Enterprise for the backend to my Creator-based web application.My Current problem is getting the updated EJB sets to my current project.
    For Ex:
    If i add a new Business method called doSomething( ),then i should be able to get that method in JSC using FinalFacadeRemoteClient1.doSomething().
    But after typing FinalFacadeRemoteClient. , doSomething() method is not displaying.
    If i use that in a new project [Previously not used Same Session Facades]all the updated EJB business methodss are coming.I want to use updated EJBs in the project i'm already working.
    Regards
    Kajanan

  • Disk utility gets "invaild record count"

    Hello, Using Macbook pro running OSX 10.9.2
    Yesterday, i was using my computer searching internet, plugged it in and walked away for about 5 mins. Came back and tried to open iTunes. I 1st choose iTunes using the button w/ the 6 squares on it on the top row of keyboard. Nothing happen and iTunes did not open. 2nd I tried to open iTunes using the dashboard. Again nothing happen. I used the power button to shut down the computer. Then restarted, it came up with a window asking which language I would like to use. I choose English and then a new window opens with 4 choices; "Restore using Time machine", "Reinstall OSX", "Get online help" (which is how I am here now), and "use disk utility". I picked disk utlity and verified the disk which popped up a window say it "stopped and needed to be repaired. I hit the "repair buttom" and got a "Invaild record count" in red. It then stopped and said it could not be repaired.
    Tried to restore using the back-up/restore with Time machine. It found time machine, but on about the 4th screen it asks which volume I would like torestore to. Nothing comes up and just says "searching for disks" None ever come up. I quit disk utility and then choose "Start up disk" under the apple menu. It doesn't find anything. I tried the "command + option + P + R" nothing is different.
    So here I am. each new screen that comes up flickers a lot before clearing.
    Dead hard drive?
    Just can't find it?
    What's next?
    Thank you for being here to help
    Jody

    Thank you dominic23.
    I tried the instructions listed by Chris Watts1 and after running the /sbin/fsck_hfs -yprd /dev/disk0s2
    it never asked for a password just said "starting". After waiting a couple mintues it came back with the following: (which I have no idea what any of it means)
    journal_reply (/dev/disk0s2) returned 22
            using cacheBlockSize = 32K  cacheTotalBlock = 16384  cacheSize = 524288K.
    Executing fsck_hfs (version hfs-226.1.1).
    **Checking journaled HFS Plus volume.
    hfs_swap_BTNode: invalid forward link (0xA9812964)
    hfs_swap_BTNode: invalid backward link (0x0B69B6DB)
    hfs_swap_BTNode: invalid node kind (-124)
    hfs_swap_BTNode: invalid node height (42)
    hfs_swap_BTNode: invalid record count (0x3E6B)
    Invalid record count
    (3, 3)
    **The volume could not be verified completely.
    volume check failed with error 2
    volume type is pure HFS+
    Primary MDB is at Block 0 0x00
    Alternate MDB is at Block 0 0x00
    Primary VHB is at Block 2 0x02
    Alternate VHB is at Block 975093950 0x3a1ec0be
    Sector size = 512 0x200
    VolumeObject flags = 0x07
    total sectors for volume = 975093952 0x3a1ec0c0
    total sectors for embedded volume = 0x00
    CheckHFS returned -1317 , fsmodified = 0
    Does any of this mean anything to you?
    thank you again,
    Jody

  • Get the record count

    The Query below is part of a huge query. The snipet is just the part that I need to make a change.
    For the query below, how can I get the recordcount in the select inside the case statement? I want to only output the r_text when the record count of the select is zero (0) else make the output to r_text null
    select
    distinct a.style_id, b.sty, b.season, a.cust, a.ad_d, b.code,
    (case when b.code = 'MAKE' then
    (select min(t.value) from sn.age r, sn.text t
    where r.t_id = '18' and r.name = 'MTGNSL'
         and r.t_id = t.t_id
         and r.name = t.name and r.text_id = t.text_id
         and r.id_1 = a.id
    ) end) r_text,
    (case when b.code is null then 'Blank Code'
    when b.code = 'MAKE' then 'MAKE' end) err
         

    If you are not using a scrollable result set then the following is the best way to do it.
    there are several key words in SQL that can be used, the one you are interested in is count();
    so if your query at the moment is
    "select col1, col2, col3 from my_table where col2=? and col3=?"you can work out how many rows will be returned by executing this command first
    "select count(col1) from my_table where col2=? and col3=?"this will return a result set with one row and one column, you can get the row count as follows:
    ResultSet rs = ps.executeQuery();
    int rowCount = rs.getInt(1);I hope this helps :)

  • Getting a record count in a query using UNIQUE

    I need to know how to grab a record count for a query so I can pass it back into the recordset.
    This select query uses UNIQUE to rollup the 555 records to 125 unique rows.
    But how would I do a record count.
    Do I pass the query to a cursor and then count the records in the cursor?
    Please detail your help please.
    Thank you in advance.

    SELECT unique
         CE.DATE_OF_SERVICE AS DOS_FROM
         ,CE.SERVICE_END_DATE AS DOS_TO
         ,CE.EVENT_SERVICE AS SERVICE_TYPE
         ,CN.CREATE_DATE_TIME
         ,CN.CASE_NOTE_ID
         ,CN.CASE_ID
         ,CN.EVENT_ID
         ,CN.REASON
         ,CN.CREATOR_USER_ID AS CREATOR_ID_USED
         ,CN.ROWID AS ROW_ID
         ,(SELECT Retrieve_Note2(CN.CASE_ID,CN.CASE_NOTE_ID) from DUAL) AS NOTE
    FROM
         MEMBER_TO_PATIENT MTA,
         CARE_EVENT CE,
         CASE_NOTES CN
    WHERE
         MTA.SUBSCRIBER_LID = '1260016473015' AND
         MTA.CASE_ID = CN.CASE_ID AND
         CN.EVENT_ID = CE.EVENT_ID
    ORDER BY
         CN.CASE_NOTE_ID DESC

  • Problem with getting updates to install

    On one of my computers, I have been having problems getting windows updates to complete They either error out right away with codes that I cannot find any information on. Or, they run correctly but during restart, they error out at 90% (reverting) and never
    get installed. This is a Windows 7 SP1 computer and there are about 50 updates that cannot install. I notice that after the update attempt the Windows Update log has the following error:
    DnldMgr ***********  DnldMgr: New download job [UpdateId = {F534C799-3255-44C5-841B-F78F82435AD0}.202]  ***********
    DnldMgr Regulation: {7971F918-A847-4430-9279-4A52D1EFE18D} - Update F534C799-3255-44C5-841B-F78F82435AD0 is "PerUpdate" regulated and can NOT download. Sequence 1753 vs AcceptRate 0.
    DnldMgr   * Update is not allowed to download due to regulation.
    Seems like a problem but there is no information on this error if I search for it.
    Also, I have run the System Update Readiness Tool (KB947821)several times and I was able to remover some of the errors it found except and error with KB2570791 that I cannot fix. It has errors with some fonts (I think), so I tried to remove the update. However
    it runs for a while and then says that the update cannot be removed ad quits. So I am stuck with a computer that cannot be updated.

    Here is the forum for Win. Update

  • Problem in getting updated data of VO

    I have a jspx page which have one ADF input LOV alongwith other controls. I have also a valueChangeListener attached with it so that whenever, user changes value, i want to process that value along with other values in VO which are set by LOV in the background. Now the problem is that in valueChangeListener when i access VO and currentRow of that VO, It shows previous values i.e. VO is not updated at the moment and ValueChangeListener is called first. How i can refresh VO first before calling ValueChangeListener.

    Now the problem is that in valueChangeListener when i access VO and currentRow of that VO, It shows previous values i.eThis is expected. The new value you expect to see will only be available in event.getNewValue().
    The valueChangeListener is invoked in Process Validations and Apply Request Values phases.
    Values are set in the datacontrols/VO row in a later phase (Update model phase)...
    Ref: http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_lifecycle.htm#insertedID2

  • Problem in getting update

    Hey dere m using nokia asha 501 nd i really love it...
    My phn earlier had got a notification about firmware update but i was unable to update my device due to not having internet access...
    Now due to some reason by creating backup...i had reset my phn a day before...
    And now i m unable to get the update for the same...
    Via mobile data i have tried it in the settings but it is showing "cant validate the certificate Do you want to continue anyway?" and yes/no options are displayed but both of them are not working ..
    Kindly suggest what should i do....??
    P.S:I HAD ALSO TRIED IT VIA WIFI...!!

    Hi Luka316,
    Welcome to the forum!
    What phone model is this? If its Nokia Asha phones, these are the things you must consider before having a software update:
    - It’s recommended to use a WI-FI connection.
    - Make sure your phone battery is charged.
    - Check that the phone time and date are set correctly.
    - You can force to check for an update immediately by switching off and back on "Check via mobile data" from the “Phone update” menu.
    - It’s recommended to backup your data before updating your phone software.
    - You can create a backup in Settings > Backup.
    - Creating a backup requires a MicroSD card inserted in the phone.
    Keep us posted. 

Maybe you are looking for

  • I have lost my iTunes library. How can I get my library back?

    My iTunes library was stored on an external hard drive. Given that the MTBF of these drives is probably measured in months, I realize this was a bad decision on my part; nonetheless, it happened. How to I get my library returned to me?               

  • Problems with KVR13S9S8/4 RAM cards

    Hello! I just bought two memory cards Kingston ram model KVR13S9S8 / 4. Currently I have 4GB of Ram and just bought two 4GB cards. When installing my Mid 2010 iMac 21.5 does not work properly. Fails to start. O shows me a Kernel Panic message. This m

  • Help on summing data

    I have below two tables:          Table A           col1 col2           1     10           1     10           1     10           Table b           Col1 col2           1    20           Desired output:           a.col1 sum(a.col2),sum(b.col2)         

  • WLP 9.2 - JSR-168 with beehive compatibility

    Hi all, I've got the following task - migrate WL pageflow portlets (based on beehive) to JSR-168. As far as I know there is no beehive-JSR168 bridge hence don't know how to run this migration in a clean way. Has anybody already had such a problem? Wi

  • Hide Button Create Corporate Account/Individual Account/Group in Result

    Hello, how can i hide the Button Create Corporate Account/Individual Account/Group in ResultList of Account Search. Thanks, TomSd