Resultset after insertion is the same before insertion

hi guys, i get an updatable resultset from a connection then used it to insert a new row but the result set doesn't chane after insertion, i mean the no of rows before insertion is the same after insertion and also the data, this is the code prove what i say
          int currentRow = resultset.getRow();
          display(resultset);
          resultset.moveToInsertRow();
          for (int i = 0; i < fields.size(); i++) {
            updateCurrentRow(resultset, fields.getField(i));
          resultset.insertRow();
          display(resultset);the display function body is
        int currentRow = res.getRow();
        res.first();
        while (true)
          System.out.println("CountyCode= " + res.getInt(1));
          System.out.println("CountyName= " + res.getString(2));
          if (!res.next())
            break;
        res.absolute(currentRow);Please help me
N.B.
the type of resultset after creation it is res.getConcurrency() == ResultSet.CONCUR_UPDATABLE?????
Thanks for your efforts

thnaks for your reply, but when i used
ownInsertsAreVisible() method; returned true, that is
mean that the driver and DB supports the updating of
reultset after insertion. but this is not real at my
case? that was strange. if you have any comment please
do,just checking the row is in fact being inserted into the database? i mean you can't see it right away but you can see it later right?
if the row is being inserted and the ownInsertsAreVisible() returns true then there are two possible scenarios.
1) the cursor type of your result set does not support that method, meaning the method is true in some cases but not yours... for example your query might have a join or something which makes it not possible for the result set do be fully cognizant of changes. and sometimes there are database specific cursors that have to specified as part of your query in a proprietary way to get the "right" cursor. you will need to investigate the docs for your database to figure out if any of this is true.
2) the meta data is lying.

Similar Messages

  • Data from 2 database blocks insert into the same base table?

    Hello,
    I have canvas C_NEW. On this canvas, items from 3 blocks are usable by the user.
    1. Block NEW_HEAD: 3 items say X1,X2,X3
    2. Block NEW : multi record text fields say Y1 thru Y10. Also a scrollbar.
    3. Block NEW_ACTION: 6 buttons say B1 thru B6 (One of them is N_OK which is the item in question)
    both the blocks NEW, NEW_HEAD are db blocks and have the same base table say BT. When the users click on the N_OK (after filling out the data in the NEW_HEAD block and then NEW in that order) I need the data from both the NEW, NEW_HEAD to go into the BT. Currently only the data from the NEW is going into BT. Fields in the BT table which correspond to the fields X1,X2,X3 in the NEW_HEAD remain null after clicking the N_OK button. I put commit_form in the N_OK code since both the blocks are db blocks( and as suggested by folks, it is easier to issue a commit_form than do a lot more work in writing my own SQL).
    How can I achive this?
    Thanks,
    Chiru

    I tried doing what you suggested by putting the following code in the program unit which gets called when_button_pressed.
    PROCEDURE P_SAVE IS
    v_lc_no number;
    v_lc_seq number;
    v_dmg_allow number;
    BEGIN
      Go_Block('B_new_head');
      v_lc_no:= :B_new_head.N_LC_NO;
      v_lc_seq:= :B_new_head.N_LC_SEQ;
      v_dmg_allow:= :B_new_head.N_LC_DMG_ALLOW;
      Go_Block('B_new');      
    FIRST_RECORD;
    LOOP     
         emessage('before insert'||v_lc_no||'-'||v_lc_seq||'-'||:B_new.order_no);
      INSERT INTO ct_lc_import(
        LC_NUMBER,
        LC_SEQ,
        DAMAGE_ALLOWANCE,
        ORDER_NO,
        QTY_SHIPPED,
        UNIT_PRICE,
        DRAFT_AMOUNT,
        TICKET_DEDUCTION,
        SHIPMENT_PENALTY,
        TOTAL_DEBIT,
        DEBIT_DATE)
        VALUES (v_lc_no,
                v_lc_seq,
                v_dmg_allow,
                :B_new.order_no,
                :B_new.qty_shipped,
                :B_new.unit_price,
                :B_new.draft_amount,
                :B_new.ticket_deduction,
                :B_new.shipment_penalty,
                :B_new.total_debit,
                :B_new.debit_date);
       commit;
      NEXT_RECORD;
       if :SYSTEM.LAST_RECORD='TRUE' then
             emessage('last record');
             EXIT;
       end if;
      --NEXT_RECORD;
    END LOOP;
    EXCEPTION
       when FORM_TRIGGER_FAILURE then
          raise;
       when OTHERS then
          emessage(SQLERRM);
          raise FORM_TRIGGER_FAILURE;
    END;But I can't see the records in the table eventhough the message pops up with the values before inserting the 1st record. It then exits. I would think it would atleast insert the very first record into the the table at the least.
    Thanks,
    Chiru

  • CLR trigger - handling multiple inserts at the same time

    Hi
    I've developed a CLR trigger which operates on inserts performed on a staging table. The trigger implements some business logic and then inserts or updates a record in a target table. Whether an insert or update is performed depends on whether
    a record with the same ID already exists in the target (i.e. a select * from target where ID = 123).
    This works fine in most scenarios, but occasionally I am getting duplicates in the target table and have noticed that this seems to occur when inserts on the staging table happen at exactly the same time (i.e. multiple inserts for the same ID at
    the same time). In this situation duplicates are created in the target table because at the time of the inserts, no record with that ID exists in the target table (i.e. the select returns no records), therefore a new record is created for each.
    Is there a known way to deal with this scenario? For example, would locking the target table on insert result in the subsequent selects against the target table waiting until the target table had been updated, therefore the select would return a record
    for the given ID.
    I didn't really want to lock the whole target table on insert, because there are potentially other users reading that table (selects) and these would also have to wait for the insert to complete.
    I'd appreciate any thoughts on how to deal with this and avoid duplicates in the target table. I'm unable to change the way the data is coming in to the staging table, so my trigger code must deal with the above scenario.
    Thanks in advance.
    John

    First if you do not want any duplicate values in a column (or combination of columns) you should add a constraint to ensure this is never possible. A
    unique index
    like this should do this trick.
    CREATE UNIQUE NONCLUSTERED INDEX [IX_yourIndexName] ON [dbo].[YourTableName]
    [yourColumn1] ASC,
    -- add more columns that make the unique combination that you don't want repeated
    You can then add a try/catch block in your trigger code, if you get an exception based on this index then the record was created by another executing instance of this trigger and in that case you should do an update (or not, not sure what the rest of your
    logic is) in your catch block. This is the easiest solution and does not involve table locks. The only drawback is the first one to commit the insert will win and you have no guarantee which process or data set that will be. Also i have no idea how big the
    table is, how frequently changes are made, and what the data type is so you should
    keep this in mind when creating your index so you don't run into unexpected high index fragmentation which can lead to performance problems when executing updates and inserts.
    You could also create a
    named transaction with scope serializable around your insert/update block and execute your reads using a
    NOLOCK hint
    which should allow them to retrieve uncommitted writes and not create a long wait. The downside is is that the data might not be 100% accurate depending on if a transaction fails or not if there happens to be an update at the same time as a select but maybe
    this is not a big deal to the calling code.
    -Igor

  • HT204053 i'm using same apple id for my ipad & ipod but after start using the same apple id on my ipad, i can't upadte my free software, it's showing "YOU CAN NOT UPDATE THIS SOFTWARE SINCE YOU HAVE NOTOWNED THE MAJOR VERSION OF THIS SOFTWARE" so how I ca

    I'm using same apple id for my ipad & ipod but after start using the same apple id on my ipad, i can't update my free software downloaded on both, it's showing "YOU CAN NOT UPDATE THIS SOFTWARE SINCE YOU HAVE NOT OWNED THE MAJOR VERSION OF THIS SOFTWARE" so how i can update my softwares on ipad & ipod using the same apple id

    I think the issue is that iTunes (for whatever reason) thinks I have two Apple ID's.
    also, to further complicate the issue, when i try updating the apps from my iPod the iTunes store is still recognizing my old hotmail Apple ID. So when I go to enter my password it won't accept because it doesn't match with the old Apple ID, even though it is the same account (just new Apple ID name).
    I have tried signing out within the App Store and re-signing in with my Apple ID but it still brings up my old Apple ID name when I try to update.

  • In iphoto, how do i save a photo after editing, in the same or higher file size, it's saves in a lower size

    in iphoto, how do i save a photo after editing, in the same or higher file size, it's saves in a lower size

    It's rather more complicated that this.
    iPhoto is a lossless editor. You don't lose any quality on your shot in iPhoto.
    The file size you see reported is the size of your iPhoto Preview: this is what gets used if you access the data via a media browser. It's a "good-enough-for-most-uses" version of the shot. Email it, upload to websites, use it in Presentation, Word processing file etc
    If you want to set the quality yourself then Export the photo using the File -> Export command.
    You can choose to export to Jpeg, Tiff or png. Tiff is lossless but the file sizes are up to 10 times larger. Jpeg allows you to choose different qualities: High, Medium or low. The difference is the amount of compression involved. High quality means very little compression. It's not unusual for photos exported at this setting to have a larger file size than the original.
    Which setting you choose depends on the use you intend. Further editing, printing then high is important. Sending to Facebook? Well low will do just fine there as they're going to trash the file anyway.
    But the key point: the file size only becomes an issue when you export.
    Regards
    TD

  • I forget to charge my MacBook Pro and it turns off because of that. Now it wont automatically connect to saved networks. I have to put in manually to make it work. Even after restating still the same. Sometimes pulling the Battery out fixes it

    I forget to charge my MacBook Pro and it turned off because of that. Now it wont automatically connect to saved networks. I have to put in manually to make it work. Even after restating still the same. If I close the lid it looses conection. Sometimes pulling the Battery out will fixes it untill we forget to chage it.
    Mac OS X version 10.6.8

    I forget to charge my MacBook Pro and it turned off because of that. Now it wont automatically connect to saved networks. I have to put in manually to make it work. Even after restating still the same. If I close the lid it looses conection. Sometimes pulling the Battery out will fixes it untill we forget to chage it.
    Mac OS X version 10.6.8

  • Concurrency when inserting in the same table

    Hi,
    I have a report used by several users and in this record there is a sentence to insert in a z table. My question is, what happens whether two or more users are inserting records in that table at the same time?  There is a concurrency problem, isn't there?
    How does SAP manage this issue? or, what must I do in this case?
    Thanks in advance.
    Regards.

    Hi David,
    As SAP applications are accessed by many end users at same time, SAP has concept called LOCKING of particular tables involved in the transaction.
    You can achieve your requirement as below
    Go to t-code SE11, and create a lock object for your Ztable
    Now, system create 2 function modules - 1 for locking ENQUEUE_* & other for un-locking DEQUEUE_*  ( search for function module in SE37 )
    Before saving data to ZTABLE, call function module ENQUEUE_* to lock the table for writing data, if locking fails, means there is somebody already working on it, hence you can display error message
    After Save action, you can unlock the table by using FM ... DEQUEUE_*
    Note: you can lock and unlock event during DISPLAY/CHANGE mode if your requirement requires.
    Hope this helps you.
    Regards,
    Rama

  • Two records getting inserted with the same timestamp...

              hi all,
              I am trying to submit a form . Now whenever I click submit before I insert any
              data sent in that form I make a check (SELECT stmt. to see if that record can
              be inserted ...few business validations..) and if the check is successful I then
              proceed for the necessary insert into a table the Primary key for which is a running
              Oracle sequence.
              But if I click on the Submit button twice in close succession I have observed
              may be 1 in 1000 attempts I am able to submit two records with the same time stamp
              for the date of insertion . We are using Oracle 8 with weblogic 5.1. And I don't
              think ORACLE's date precision is beyond seconds.
              So any suggestion ..what is the best way to handle such things : one can be
              to place the same business validation check just before the ending brace of the
              method , or secondly sucmit the form thru javascript and don't submit it twice
              even if the user clicks the submit button twice... any suggestion which u can
              give .. are welcome.
              thnx in advance
              sajan
              

    Is the pkey a timestamp or an Oracle sequence? The latter will always work,
              since no two requests to a sequence can get the same value (rollover
              excluded). If you must use timestamp, then you must auto-retry the insert
              if the first attempt fails. Oracle does have higher precision than seconds,
              but I can remember the exact precision ... I am pretty sure it works out to
              at least two or three digits though.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              Tangosol Server: Enabling enterprise application customization
              "Sajan Parihar" <[email protected]> wrote in message
              news:[email protected]...
              >
              > hi all,
              > I am trying to submit a form . Now whenever I click submit before I
              insert any
              > data sent in that form I make a check (SELECT stmt. to see if that record
              can
              > be inserted ...few business validations..) and if the check is successful
              I then
              > proceed for the necessary insert into a table the Primary key for which is
              a running
              > Oracle sequence.
              > But if I click on the Submit button twice in close succession I have
              observed
              > may be 1 in 1000 attempts I am able to submit two records with the same
              time stamp
              > for the date of insertion . We are using Oracle 8 with weblogic 5.1. And I
              don't
              > think ORACLE's date precision is beyond seconds.
              > So any suggestion ..what is the best way to handle such things : one
              can be
              > to place the same business validation check just before the ending brace
              of the
              > method , or secondly sucmit the form thru javascript and don't submit it
              twice
              > even if the user clicks the submit button twice... any suggestion which u
              can
              > give .. are welcome.
              >
              > thnx in advance
              > sajan
              

  • Multiple inserts for the same object

    We have observed that in certain cases, the same object is attempted to be inserted twice, resulting in Primary Key violation.
    Here is one example -
    A(1->1)B, unidirectional, A has the foreign key to B
    new B
    copyB = register(B) (also assign sequence number)
    new A1, A2
    A1.set(copyB), A2.set(copyB)
    register(A1), register(A2)(also assign sequence number)
    commit
    it tries to insert the same B twice.
    any clues whats wrong here?
    thanks

    Any chance your 1:1 from A to B is marked as privately-owned?
    This would indicate to TopLink that the object in each relationship is unique and should be inserted.
    Doug

  • MULTIPLE UPDATES/INSERTIONS TO THE SAME TABLE

    How can I update/insert mutiple rows into the same table from one form ?

    Hi,
    Using the portal form on table you can insert only a single row. You can use master-detail form to insert multiple rows.
    Thanks,
    Sharmila

  • Create & insert in the same time

    hi does any one know why it's impossible to insert values in a table in the same time of creation? I know that's impossible to do so i want to know why?

    why not ? if you use select statement for table creation.
    SQL> select * from temp_emp;
    select * from temp_emp
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> create table temp_emp as select * from emp;
    Table created.
    SQL> select * from temp_emp;
         EMPNO ENAME                                              JOB              MGR HIREDATE         SAL 
          7369 SMITH                                              CLERK           7902 17-DEC-80        880        
          7499 ALLEN                                              SALESMAN        7698 20-FEB-81       1600 
          7521 WARD                                               SALESMAN        7698 22-FEB-81       1250 
          7566 JONES                                              MANAGER         7839 02-APR-81       2975        
          7654 MARTIN                                             SALESMAN        7698 28-SEP-81       1250 
          7698 BLAKE                                              MANAGER         7839 01-MAY-81       2850        
          7782 CLARK                                              MANAGER         7839 09-JUN-81       2450        
          7788 SCOTT                                              ANALYST         7566 19-APR-87       3000        
          7839 KING                                               PRESIDENT            17-NOV-81       5000        
          7844 TURNER                                             SALESMAN        7698 08-SEP-81       1500        
          7876 ADAMS                                              CLERK           7788 23-MAY-87       1100        
          7900 JAMES                                              CLERK           7698 03-DEC-81       1045        
          7902 FORD                                               ANALYST         7566 03-DEC-81       3000        
          7934 MILLER                                             CLERK           7782 23-JAN-82       1300        
          7500 DEV                                                MD                                   5000
    15 rows selected.

  • Library file not the same when inserted.

    Hello all.
    In Dreamweaver 8.0, I have a library item. When I insert it
    into a page, I thought Dreamweaver kept inserting an older version.
    I open the library file from the Assets panel, make sure it is
    correct, save it, hit the refresh button in the Assets panel, and
    I'm still getting an older version on my page.
    I've also tried recreating the site cache.
    However, I'm wondering if I'm getting a different problem.
    My library item is a set of navigation links, and the whole
    site is a subdomain. Not so unusual in itself. But because this
    file is in the folder 'library', all of the links are pointing to
    the library folder instead of the (sub) root folder. So I added the
    folder name to the links. Would Dreamweaver be automatically
    stripping the information, thinking it's redundant?
    This is my library item, a drop-down menu.

    Use a server-side include instead....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:[email protected]...
    > This isn't going to work in a subdomain.
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    > ==================
    >
    >
    > "Virginia Oh My" <[email protected]>
    wrote in message
    > news:[email protected]...
    >> Hello all.
    >> In Dreamweaver 8.0, I have a library item. When I
    insert it into a page,
    >> I
    >> thought Dreamweaver kept inserting an older version.
    I open the library
    >> file
    >> from the Assets panel, make sure it is correct, save
    it, hit the refresh
    >> button
    >> in the Assets panel, and I'm still getting an older
    version on my page.
    >> I've also tried recreating the site cache.
    >>
    >> However, I'm wondering if I'm getting a different
    problem.
    >> My library item is a set of navigation links, and
    the whole site is a
    >> subdomain. Not so unusual in itself. But because
    this file is in the
    >> folder
    >> 'library', all of the links are pointing to the
    library folder instead of
    >> the
    >> (sub) root folder. So I added the folder name to the
    links. Would
    >> Dreamweaver
    >> be automatically stripping the information, thinking
    it's redundant?
    >> This is my library item, a drop-down menu.
    >>
    >>
    >>
    >>
    >>
    >> <div style="position:absolute; width:288px;
    height:23px; z-index:11;
    >> left:
    >> 607px; top: 238px;">
    >> <div align="right">
    >> <select name="name"
    onchange="MM_jumpMenu('parent',this,0)">
    >> <option selected="selected">Quick pick
    Menu</option>
    >> <option value="../subdomain/page1.htm">Page
    1</option>
    >> <option value="../subdomain/page2.htm">Page
    2</option>
    >> <input type="button" name="Button1" value="Go"
    >> onclick="MM_jumpMenuGo('name','parent',0)" />
    >> </div>
    >> </div>
    >>
    >>
    >> When I insert it into my page, it is all the same
    except for the links,
    >> which
    >> are changed to this:
    >>
    >> <option value="../page1.htm">Page
    1</option>
    >>
    >> This is telling the link it's in the Library folder,
    which it's not.
    >>
    >> Thanks for your help.
    >>
    >> Virginia
    >>
    >

  • Posting and inserting at the same time

    How do I post the values into a database and at the same time
    get displayed on the next page using the post method. At the moment
    the values just get inserted into the database, but do not get
    displayed on the next page, what is the code behind doing this?
    Thanks

    >Opps, hang on. I'm trying to acheive your second option.
    >Show the form variables on the next page as well as
    inserting into the database.
    First off, I don't do php so I won't be able to help with
    script syntax, but I can give you an overview of the program flow.
    Now I will assume that you have 2 pages; one that contains
    the form and another that has the form processing script. You could
    actually have a single form that self posts, but I'm guessing that
    you are not doing that.
    When you submit the form, the form fields get posted to the
    php page that inserts them into the database. I don't know the php
    syntax to retrieve the posted form elements, but I assume you do
    since you already must be doing this to get your insert working.
    Once the insert routine on the page has completed, you write
    out html to the page that includes the form field values. If you
    want, you can just copy the form from the previous page to use as
    the basis for the display page. Just insert the form contents with
    the php variables holding the posted field values.
    If you're still not clear, it might be helpful to provide a
    url so we can see exactly what you are trying to accomplish.

  • Why won't using 'Insert' work the same way on the Photos page?

    Because my images I edited in Photoshop don't appear in my iphoto Library or in the 'media' section (I have no idea why!!), I have to go to the toolbar at top, and use "Insert....Choose....pictures....etc" and insert the pics that way. But it won't insert into the photo grid and you can't add frames, and you can't click on it to enlarge. I guess I don't understand why you can 'drag' the pix in from the media section and it works fine, but when you manually insert the pics, it's just a plain pic, nothing else.
    Is there anything I can do?
    Thanks
    Kim

    Rather than use Insert, try dragging your edited images from their location on your HD into the photo grid.
    [ Visit here for iWeb Tips, Tricks and Hacks ]

  • It is so nice spending 2 hours on a phone to be hung up upon waiting for a supervisor. After being told the day before I would get a call when the customer service representiave started her shift at 7pm to give me more answers. I do not like to be stuck w

    What a frustrating experience I have had trying to get away from This phone and Plan. I just want to down grade this phone. What difference does it make to you here? All VZW will do is re certify the phone and give it to someone else. I just would like to down grade to a cheaper phone and do away with android os. I still have the same issues with the phone as I did with my other one within a hour of re activating it. I should have no issues with the os it is flawed and should not happen. I am sorry to say but The blackberry OS is a lot more stable. There may not be as many apps but it is more productive and being able to multi task is a lot more needed on a phone. I was told yesterday I would get a call back today at 7pm when this tech support lady would start her shift to give me my options and she did not call. Making me call at 930pm today and after talking to someone I waited for 45 minuets to be hung up on. That is a real great way to treat a customer and make things better. I just want away from the Andriod OS. What difference does it make to you as a company to make a customer happy who was with you since 08 and having a second device added on to the account? What Poor way to treat someone to make them happy with all the profits you have and can't give anything back to a customer.

    What a frustrating experience I have had trying to get away from This phone and Plan. I just want to down grade this phone. What difference does it make to you here? All VZW will do is re certify the phone and give it to someone else. I just would like to down grade to a cheaper phone and do away with android os. I still have the same issues with the phone as I did with my other one within a hour of re activating it. I should have no issues with the os it is flawed and should not happen. I am sorry to say but The blackberry OS is a lot more stable. There may not be as many apps but it is more productive and being able to multi task is a lot more needed on a phone. I was told yesterday I would get a call back today at 7pm when this tech support lady would start her shift to give me my options and she did not call. Making me call at 930pm today and after talking to someone I waited for 45 minuets to be hung up on. That is a real great way to treat a customer and make things better. I just want away from the Andriod OS. What difference does it make to you as a company to make a customer happy who was with you since 08 and having a second device added on to the account? What Poor way to treat someone to make them happy with all the profits you have and can't give anything back to a customer.

Maybe you are looking for

  • Remote can't find library

    hello everybody. So i've install remote on my ipod with 2.0 firmware and install remote. i've made the association. Itunes say that my remote now control itunes but remote say that library can't be found. Anybody have idea ? it's strange because alre

  • Remove Printer Name from Crystal Report

    How can i remove the printer name from the Crystal Report so that the PrinterName property of the CRAXDRT.Report object in the RDC SDK is blank WITHOUT having the "No Printer" Option checkbox checked? Here's the scenerio.  When I first create a Repor

  • IPhone cannot be synced - an unknown error occurred (13019)

    I have the blues. My iPhone cannot be synced and is rejected in iTunes with the message: "The iPhone "my iPhone name" cannot be synced. An unknown error occurred (13019)." Can someone here help me. TIA, Ken

  • Can anyone advise on how to share large files over the net?

    Hi all. So I need to share large video files over the net. The files will be between 5 and 10 GB Does anyone have a solution for this? I have been using my ftp program and just giving the recipient the download link. But its affecting my upload quota

  • Get Person who released PO before saved

    Hi Experts!! We are implementing POST method of BADI ME_PROCESS_PO_CUST. From ME29N when the release happens, and when saved, this badi will be called and I can get the current data like the release status and so on through GET_DATA of IM_HEADER (whi