Cursor only updates every second row

Hello Helpful Peoples
I have a table with a set of delivery dates, and am wanting to add a date on which a reminder flag should be raised by the system. The delivery dates are already populated and I'm wanting to add functionality where the end user can set how many days prior they are reminded.
I've opened a cursor to retrieve all the current due dates from my source table. When I loop through this cursor and update the reminder date and reminder text, my code is only updating every second row.
I can't work out why this code seems to skip a row every time it updates a record. Is anyone able to assist?
declare
v_date rep_delivery.reminderdate%type;
v_rownum number;
CURSOR reminder_cur
IS
SELECT DEL.DUEDATE
FROM REP_DELIVERY DEL
WHERE DEL.REP_ID = :P212_REP_ID:
FOR UPDATE OF DEL.REMINDERDATE;
begin
FOR x IN reminder_cur LOOP
FETCH reminder_cur INTO v_date;
EXIT WHEN reminder_cur%NOTFOUND;
v_date := v_date - to_number(:P212_REMDAYS);
UPDATE REP_DELIVERY DEL2
SET DEL2.REMINDERDATE = v_date
WHERE CURRENT OF reminder_cur;
UPDATE REP_DELIVERY DEL3
SET DEL3.REMINDERTEXT = :P212_DESCRIPTION
WHERE CURRENT OF reminder_cur;
END LOOP;
commit;
end;

Oolite,
Use this code:
DECLARE
   v_date   rep_delivery.reminderdate%TYPE;
   CURSOR reminder_cur
   IS
      SELECT        ROWID, duedate
               FROM rep_delivery
              WHERE rep_id = :p212_rep_id
      FOR UPDATE OF reminderdate;
BEGIN
   FOR x IN reminder_cur
   LOOP
      v_date := x.duedate;
      v_date := v_date - TO_NUMBER (:p212_remdays);
      UPDATE rep_delivery del2
         SET del2.reminderdate = v_date,
             del2.remindertext = :p212_description
       WHERE ROWID = x.ROWID;
   END LOOP;
   COMMIT;
END;and it will work for you.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------

Similar Messages

  • How to read two files (one is updating every second, the other is constant) simoltaneously

    Dear All,
    I will appreciate if somebody help me.
    I want to read two files, one is temperature wich is updating every second, and the other is hysteresis energy which has specific rows and is constant.
    I got a program in discussion forum which read a file as it is updating. I checked this program in my case and it works.
    Then I added reading hysteresis energy file to the existing file. But while i am running the program, the hysteresis energy file is read with all rows.
    But the aim is that everytime which temperature updates, I need to read just one row of the hysteresis energy file.
    so, in this way in every second i have a new temperature data and one row of the other file.
    I tried to used "for loop" inside the program, but it did not work, becuase reading temperature will be stopped untill for loop ends.
    I attached the program.
    Could somebody help me how to read just one row of hysteresis energy file everytime temperature updates?
    Solved!
    Go to Solution.
    Attachments:
    Readfiles.vi ‏23 KB

    I do not understand relationship between your two files.
    You have another VI or app that is writing data to both files and when new temperature data added you wish just to read the new data and then read one new line of the hysteresis file?????
    But is one is constant, why do you need to keep reading it?
    Anyway…
    The “Read From Spreadsheet File.vi” preformed an Open and a Close for each time it is called (if you will open the VI up and drill down and you will see). So that resets the file pointer back to the beginning and there for will read in the whole file from the first to the last each time if you do not set the start of read offset or number of rows.
    Now the Read from Binary File does not reset the file pointer and leaves the file pointer just past the last byte read so it will start with any new bytes automaicly only giving you the new data.
    I do not think you need to do the math with the Previous EOF=0 and the File size to get what I think you are trying to do.
    Plus use shift reg for the Data string instead of local var
    Set the mechinacl action of the stop botton to Latched
    So you do not need to init the two controls
    Also, I do not get the End of file encountered error (4) from the Read from Binary file if I attempt to read past. It just returns and empty string.
    Omar
    Attachments:
    Readfiles.vi ‏22 KB

  • ToolBoxTools.addEventListener only works every second time

    Hi!
    Our layouts pretty often click on the "page tool" by mistake and it happened a few times, that they changes the size of the page without even noticing. Because there is no way to remove the tool from the toolbar (I guess?), I wanted to write a script, that at least shows a message, that the page tool ("Seitenwerkzeug" in german) was selected. Unfortunately the event listener only works every second time:
    1. indesign starts > selection tool is active
    2. click on page tool > message appears > page tool is active
    3. click on "another tool1" > "another tool1" is active
    4. click on "another tool2" > "another tool1" is active
    5. click on page tool > nothing happens, the icon of the page tool is active, but the icon of the "another tool2" is still active, too, and "another tool2" is still activated
    6. click on "another tool3" > "another tool3" is active
    7. click on page tool > message appears > page tool is active
    8. ......
    Any idea why that is?
    My script:
    #targetengine myToolListener
    app.toolBoxTools.addEventListener ("afterAttributeChanged", changeToolAlert);
    function changeToolAlert() {
        if(app.toolBoxTools.currentToolName == "Seitenwerkzeug") {
            alert ("Message", "Title");
        exit(); //i tried with and without this!
    At the beginning I tried to use an confirm message instead of an alert, which had the same problem and I thought it might be because the changing doesn't work... but it seems I can't even work with the information without something "crashing" in the background?
    My previous confirm Function:
    function changeToolConfirm() {
        if(app.toolBoxTools.currentToolName == "Seitenwerkzeug") {
            var confirmDialog = confirm("Do you really want to activate the page tool?", true);
            if(!confirmDialog) {
                app.toolBoxTools.currentTool = UITools.SELECTION_TOOL;
    I really hope someone has an idea
    Best,
    Anke

    Hi Anke,
    The problem, I think, comes from the fact that the Page Tool selection event (which you listen to via afterAttributeChanged) needs some time to complete. Since the alert() or confirm() instruction gives the focus to a new modal window before the event life-cycle is finished, the GUI becomes instable, the PageTool icon state is not properly restored, and your event management goes wrong.
    A way to solve this might be to queue a temporary IdleEvent listener once the Page Tool selection event is caught. That is, we do not initiate any modal dialog as long as the GUI is refreshing.
    Something like this:
    //====================================================
    // PageToolDisclaimer.jsx
    //====================================================
    // Should be useable as a startup script, no #targetengine required
    // NB - MutationEvent is known to create a global 'evt' variable
    // so we don't seem to need a persistent session engine here :-)
    // That's why the active script File is used as the event handler
    (function(/*File*/EVENT_HANDLER, /*str*/TASK_NAME, /*uint*/TASK_TIME, /*str*/PAGE_TOOL_NAME)
        var t;
        // Installer
        if( !(t=app.toolBoxTools.eventListeners).length )
            t.add(MutationEvent.AFTER_ATTRIBUTE_CHANGED, EVENT_HANDLER);
            return;
        // IdleEvent handler (--> confirm)
        if( (t=app.idleTasks.itemByName(TASK_NAME)).isValid )
            t.eventListeners.everyItem().remove();
            t.remove();
            if( !confirm("***WARNING***\rDo you really want to activate the page tool?", true) )
                app.toolBoxTools.currentTool = UITools.SELECTION_TOOL;
            return;
        // PageTool event handler
        if( ('evt' in $.global) && 'currentToolName'==evt.attributeName && PAGE_TOOL_NAME==evt.attributeValue )
            evt.stopPropagation();
            app.idleTasks.add({name:TASK_NAME, sleep:TASK_TIME})
                  .addEventListener(IdleEvent.ON_IDLE, EVENT_HANDLER);
    })(app.activeScript, 'WaitPageTool', 400, app.translateKeyString('$ID/Page Tool'));
    Hope that helps.
    @+
    Marc

  • Formatting every second rows in Reports??

    Hi!Would like to add a shadow to every second row in Hyperion Reports. Cannot find a good solution to this since I'm using dynamic rows i.e. Children of xxxx.Does anybody have a good tip och trick on how to solve this.Thank you in advance,Erik

    Did you ever get resolution on this? I'm running into the same problem here and cannot figure it out myself.<BR><BR><BR>Thanks Much,

  • Looping through text files loads all 2014 files correctly, but 2013 files only loads every other row

    Hello all. I am once again stumped and would very much appreciate any help.
    I have a folder with many text files such as this...
    A 2013-03-31.txt
    A 2013-06-30.txt
    A 2013-09-30.txt
    A 2013-12-31.txt
    A 2014-03-31.txt
    A 2014-06-30.txt
    A 2014-09-30.txt
    B 2013-03-31.txt
    B 2013-06-30.txt
    B 2013-09-30.txt
    B 2013-12-31.txt
    B 2014-03-31.txt
    B 2014-06-30.txt
    B 2014-09-30.txt
    …and so on…
    and I'm loading all of the files beginning with A to an existing table in SQL Server. I'm loading the data as is to a staging table, no data type conversions, and I add only two derived columns. I have a loop to accomplish this, and it's working perfectly
    except for one detail. All of the files in 2013 load every other row. All of the 2014 files load all rows as intended.
    Any idea what would cause this? All files are being loaded using the same loop, same variables, same everything. My enumerator on the for each loop is Foreach File. The DataRowsToSkip property on the flat file connection manager is 0. I'm not sure where
    to look next. I need all rows in all files to be loaded.
    Forgot to mention that there is a difference between the 2013 and 2014 files. The 2014 files have 8 additional columns. I suspect this is causing my issue, just not sure what to do about it.
    Thanks for any help you can provide!
    WeeLass

    In SSIS 2012 and above these additional columns would not cause a failure, but looks like lead to you having impartial loads.
    I suggest you create two loops, one for one metadata - files from 2014 and another for 2013 ones.
    Arthur
    MyBlog
    Twitter

  • When I update a second row in my form I lose connection and chrash

    Hello everyone out there,
    I have a problem, and it is becoming a big problem.
    When I run my form on the web, using the 6iserver, I can update a row and commit it without any problems. If however I update another row and commit this, I get a couple of FRM-40733 PLSQL error BUILT IN DBMS_ERROR_TEXT failed Then an unhandled exception and finally I get ORA-03114 Connection lost. This is reproducable every time and seems to be occurring in al forms I generate new since a week or two! I don4t know of any changes of the enviremont on the development side.
    The error doesn4t occur on when running the form client server!
    Oracle database version 8.1.7.3.0
    9ias version 1.0.2.2.2
    We use Headstart version 6.5
    I truly hope someone knows more about this problem!
    Martijn Veldhoen

    OK - we still need to know what line this is happening at.
    As a minimum, you can put in a few message lines message('Got to line10'); etc etc So you know the line which is
    causing the problem
    Once you estanlish this - try and remove all other code and items on the Forms so that it still reproduces - this way you
    have the smallest (and simplest) reproducable test case.
    Regards
    Grant

  • When I open and close firefox about 3 times, I get the blue screen of death. Why? Also Firefox only opens every second time, and I have to close it manually to fix the problem. How can I avoid this?

    I have to close the firefox from my task list. Before I do that I can't open any web browser. This is really annoying, and I have had this problem only after using Firefox 4.

    Read Bill Hunt on BSOD http://forums.adobe.com/thread/772169
    -and an Encore fix http://forums.adobe.com/thread/1060443

  • Every second row

    Hello,
    I have a problem:
    I have a Numbers document with two sheets and two tables.
    Table 1 has 1 column and table 2 has 2 columns.
    I want two take all odd rows from table 1 to table 2, column 1 and all straight rows from table 1 to table 2, column 2.
    For example:
    Table 1:
    A
    1
    2
    3
    4
    5
    6
    7
    8
    Table two should become
    A     B
    1     2
    3     4
    5     6
    7     8
    Do you have any idea, how to do this?
    Thankyou in advance...

    In Table2:
    A1=OFFSET(Table1 :: $A$1, 2*(ROW()-1)+(COLUMN()-1), 0)
    select A1 and fill to the right
    select A1 and B1, then fill down

  • Making a clock that updates every second.

    I am at a loss and quitting for the night if anyone could help point me in the right direction I would appreciatte the advice. Here goes the code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import java.util.Date;
    import java.util.Timer;
    import java.util.TimerTask;
    public class Clock
    public static void main(String[] args)
    TimerTask task = new DateTimer();
    Timer timer = new Timer();
    timer.schedule(task, 0, 1000);
    JFrame frame = new JFrame();
    JButton button = new JButton("Date & Time");
    frame.add(button);
    final JLabel label = new JLabel("Currently: ");
    JPanel panel = new JPanel();
    panel.add(button);
    panel.add(label);
    frame.add(panel);
    class ClockViewer implements ActionListener
    public void actionPerformed(ActionEvent event)
    label.setText("Currently: " + task.getDate());
    ActionListener listener = new ClockViewer();
    button.addActionListener(listener);
    frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    private static final int FRAME_WIDTH = 500;
    private static final int FRAME_HEIGHT = 100;
    import java.util.*;
    public class DateTimer extends TimerTask
    public void run()
    Date now = new Date();
    public Date getDate()
    return now;
    private final Date now;
    Basically I am confused how to print the task out in the label.

    Hi,
    I have used [javax.swing.Timer|http://java.sun.com/javase/6/docs/api/index.html]
    Hope this will be useful to you.
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Date;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.Timer;
    public class Clock {
         public static void main(String[] args) {          
              JFrame frame = new JFrame();
              JButton button = new JButton("Date & Time");
              frame.add(button);
              final JLabel label = new JLabel("Currently: ");
              JPanel panel = new JPanel();
              panel.add(button);
              panel.add(label);
              frame.add(panel);
              ActionListener listener = new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        new Timer(1000,this).start();
                        label.setText("Currently : " + new Date().toString());
              button.addActionListener(listener);
              frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
         private static final int FRAME_WIDTH = 500;
         private static final int FRAME_HEIGHT = 100;
    }Thanks

  • Updating JTable every second, want to ignore these events in my listener

    I have a JTable that I update every second using
    table.getModel().setValueAt(data, row, col);I'm also reacting to when the user clicks on a row in a the table, using a ListSelectionListener:
    public class MyTableListener implements ListSelectionListener {
              public void valueChanged(ListSelectionEvent e) {
                   if (e.getValueIsAdjusting()) return;
                   //do stuff
    }And of course I've done this:
    table.getSelectionModel.addListSelectionListener(new MyTableListener());Problem is, every time I update the table data it generates an event handled by valueChanged() above. I need to prevent this.
    Do I need a customized table model for this?
    Thanks!

    Found the problem: I forgot I was using JXTable, not JTable. Here's my example:
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.awt.*;
    import org.jdesktop.swingx.*;
    public class Test {
         JXTable table = null;//change this to JTable to fix
         public class MyTableListener implements ListSelectionListener {
              public void valueChanged(ListSelectionEvent e) {
                   System.out.println("event="+e.toString());
         public Test()
              JFrame frame  = new JFrame();
              String columns[] = {"one", "two"};
              Object data[][] = {{0, 0}, {0, 0}, {0, 0}};
              table = new JXTable(data, columns);//change this to JTable to fix
              table.getSelectionModel().addListSelectionListener(new MyTableListener());
              frame.add(new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED),
                          BorderLayout.CENTER);
              startThread();
              frame.setVisible(true);
         public static void main (String args[]) {
              Test test = new Test();
         public void startThread()
              class RefreshThread extends Thread {
                   public void run() { try {
                             while(true) { SwingUtilities.invokeLater(new Runnable() {public void run() {
                                       updateTable();
                                  sleep(1*1000);
                        } catch (Exception e) {e.printStackTrace();}
              RefreshThread rt = new RefreshThread();
              rt.start();
         public void updateTable()
              TableModel model = table.getModel();
              try {
                   for(int row = 0; row < model.getRowCount(); row++)
                        model.setValueAt(System.currentTimeMillis(), row, 0);
                        model.setValueAt(System.currentTimeMillis(), row, 1);
              } catch (Exception e) {
                   e.printStackTrace();
    }When I change it to a JTable, valueChanged() is not called every time I programmatically update the table.
    If it's a JXTable, valueChanged() is called with every update. Annoying!
    To compile/run the JXTable version you'll need something like
    java -cp swingx-1.0.jar:. TestAs for the events themselves, I added print statements with e.toString() and the events are not distinguishable from user interaction. I wonder if this is a JXTable bug or feature.
    Thanks!

  • Rules file lodas only every 2nd row from .txt source

    I have prepared a nice rules file, now deployed on the live
    server. when I copy it over to my dev it stops working because
    it loads only every SECOND row from my .txt source.
    Any ideas why that might happen? (I have no rejects specified)

    I wonder, are the live server and the dev server the same operating system? My first thought (and I have not tested) is that perhaps the line terminator in the data file is causing the every other line load?

  • Why is the second row in the recordset not updated?

    Hi,
    I have this problem.
    I have written a servlet named processPOItem.
    The following is the doPost Method in the processPOItem class:
    public class processPOItem extends HttpServlet {
    //attributes
    public String strPO;
    ConnectionPool connectionPool = null;
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, java.io.IOException {
            int counter=0, remainder=0;
            String SearchPOItems;
            String strStatus, ISBN;
            String price;
            response.setContentType("text/html"); //html output
            PrintWriter out = response.getWriter();
            //get the parameter named PO
            strPO = request.getParameter("PO");
            Connection dbConn = null;
            try{  
                out.println("<html>");
                out.println("<head>");
                out.println("<title>Purchase Order " + strPO + "</title>");
                out.println("</head>");
                out.println("<body>");
                out.println("<table width=600 border=0 align=center>");
                out.println("<tr>");
                out.println("<td colspan=4 align=center>");
                out.println("<font face=Arial size=2>");
                out.println("<b>Purchase Order: " + strPO + "</b>");
                out.println("</font>");
                out.println("</td>");
                out.println("</tr>");
                out.println("</table>");
                out.println("<form method=post action=processPOItem>");
                out.println("<input name=updatePO type=hidden value=1>");  
                out.println("<table width=800 border=0 cellspacing=1 cellpadding=0 align=center>");
                out.println("<tr bgcolor=\"#990000\">"); //Display the mb_PurchaseItem
                out.println("<td align=center><b><font size=1 face=Verdana color=\"#FFFFFF\">No</font></b></td>");
                out.println("<td align=center><b><font size=1 face=Verdana color=\"#FFFFFF\">ISBN</font></b></td>");
                out.println("<td align=center><b><font size=1 face=Verdana color=\"#FFFFFF\">Title</font></b></td>");
                out.println("<td align=center><b><font size=1 face=Verdana color=\"#FFFFFF\">Status</font></b></td>");
                out.println("<td align=center><b><font size=1 face=Verdana color=\"#FFFFFF\">Quantity</font></b></td>");
                out.println("<td align=center><b><font size=1 face=Verdana color=\"#FFFFFF\">Unit Price</font></b></td>");
                out.println("<td align=center><b><font size=1 face=Verdana color=\"#FFFFFF\">Delivered Date</font></b></td>");
                out.println("</tr>");
                //get the SQL statement
                SearchPOItems = searchSQL(strPO);
                //get free connection from Pool
                dbConn = connectionPool.getConnection();
                //create a statement object
                Statement stmt = dbConn.createStatement();
                //create the recordset
                ResultSet rs = stmt.executeQuery(SearchPOItems);
                //display the recordset
                while (rs.next())
                    counter++;
                    remainder = counter % 2;
                    if (remainder == 0)
                       out.println("<tr bgcolor=\"#C1C1C1\">");
                    else
                       out.println("<tr bgcolor=\"#E1E1FF\">");
                    //Display the individual Purchase item under the customer
                    out.println("<td align=center><font size=1 face=Verdana>" + counter + "</font></td>");
                    ISBN = rs.getString("mb_ISBN");
                    out.println("<td align=center><font size=1 face=Verdana>" + ISBN + "</font></td>");
                    out.println("<td align=center><font size=1 face=Verdana>" + rs.getString("mb_Title") + "</font></td>");
                    strStatus = rs.getString("mb_Status");
                    out.println("<td align=center><font size=1 face=Verdana>");
                    out.println("<select name=\"mb_Status" + ISBN + "\">");
                    out.println("<option value=PENDING");
                    if (strStatus.equals("PENDING"))
                       out.println("selected>Pending</option>");
                    else  
                       out.println(">Pending</option>");
                    out.println("<option value=PROCESSING");
                    if (strStatus.equals("PROCESSING"))
                       out.println("selected>Processing</option>");
                    else  
                       out.println(">Processing</option>");               
                    out.println("<option value=DELIVERED");
                    if (strStatus.equals("DELIVERED"))
                       out.println("selected>Delivered</option>");
                    else  
                       out.println(">Delivered</option>");
                    out.println("<option value=CANCELLED");
                    if (strStatus.equals("CANCELLED"))
                       out.println("selected>Cancelled</option>");
                    else  
                       out.println(">Cancelled</option>");
                    out.println("</select>");
                    out.println("</font>");      
                    out.println("</td>");
                    out.println("<td align=center><font size=1 face=Verdana>" + rs.getString("mb_Qty") + "</font></td>");
                    /*price = rs.getString("mb_Price");
                    NumberFormat moneyAmount = NumberFormat.getCurrencyInstance();
                    Double dPrice = Double.parseDouble(price);
                    out.println("<td align=center><font size=1 face=Verdana>" + rs.getString("mb_Price") + "</font></td>");
                    out.println("<td align=center colspan=2><font size=1 face=Verdana>");
                    if (strStatus.equals("DELIVERED"))
                        //status = "DELIVERED"
                        out.println("<input align=center name=\"deliveredDate" + ISBN + "\" type=text size=10 maxlength=10 value=" + rs.getString("mb_DeliveredDate") + ">");    
                    else
                        out.println("<input align=center name=\"deliveredDate" + ISBN + "\" type=text size=10 maxlength=10 value=Nil disabled>");
                    out.println("</font>");   
                    out.println("</td>");
                    out.println("</tr>");
                out.println("<tr><td> </td></tr>");
                out.println("<TR>");
                out.println("<TD colspan=3 align=center>");
                out.println("<INPUT TYPE=submit BORDER=1 value=update name=update>");
                out.println("</td>");
                out.println("<TD colspan=3 align=center>");
                out.println("<a href=\"javascript:window.close()\"><img src=\"Close.gif\" BORDER=0></a>");
                out.println("</td>");
                out.println("</tr>");
                out.println("<tr>");
                rs.close();  
                stmt.close();
                out.println("</form>");
                out.println("</table>");
                out.println("</body>");
                out.println("</html>");
                out.close();
            catch (Exception e)
                //sendErrorToClient(out, e); //send stack trace to client
                System.out.println(e.getMessage());
            finally{
                //return connection to Pool
                connectionPool.returnConnection(dbConn);
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, java.io.IOException {
               response.setContentType("text/html"); //html output
               PrintWriter out = response.getWriter();
               Connection dbConn = null;
               //get the parameters posted back by processPOItem servlet
               String processingAll = request.getParameter("processingAll");
               String deliveredAll = request.getParameter("deliveredAll");
               String deliveredDate = request.getParameter("deliveredDate");
               String refInvoice = request.getParameter("refInvoice");
               String refNumber = request.getParameter("refNumber");
               //String status = request.getParameter("status");  
               //check if update button is pressed
               String updatePO = request.getParameter("updatePO");
               //sql statement variable
               String sqlUpdatePOStatus;
               String isbn, poItemStatus;
               //update button was pressed
               if (!updatePO.equals(""))
                try{
                    //get the SQL statement
                    String SearchPOItems = searchSQL(strPO);
                    //get free connection pool
                    dbConn = connectionPool.getConnection();
                    //create a statement object
                    Statement stmt = dbConn.createStatement();
                    //create the recordset
                    ResultSet rs = stmt.executeQuery(SearchPOItems);
                    int index = 0;
                    //display the recordset
                    while (rs.next())
                      isbn = rs.getString("mb_ISBN");
                      poItemStatus = request.getParameter("mb_Status" + isbn);
                      out.println(isbn + " " + poItemStatus);
                      out.println("<br>");
                      //update the status of individual PO item
    if (!poItemStatus.equals(""))
    sqlUpdatePOStatus = updatePOItemSQL(strPO, isbn, poItemStatus);
    stmt.executeUpdate(sqlUpdatePOStatus);
                    rs.close();  
                    stmt.close();
                    out.close();
                catch (Exception e)
                    System.out.println(e.getMessage());
                finally{
                        //return connection to pool
                        connectionPool.returnConnection(dbConn);
    }When I perform a form submit in my doGet() method, the doPost Method() responsed. However, it encounter error in updating the second row in the recordset as highlighted in bold.
    After the first row is updated. The second row did not get updated at all.
    The error return was "Resultset is closed".
    What actually is wrong? How can I execute a sqlstatement inside a recordset? How to solve this problem?

    Did you turn on the "updatable" switch for the result
    set?
    public Statement createStatement(int resultSetType,
    int resultSetConcurrency) throws
    SQLException
    Parameters:
    resultSetType - a result set type; see
    ResultSet.TYPE_XXX
    resultSetConcurrency - a concurrency type; see
    ResultSet.CONCUR_XXX
    static int CONCUR_UPDATABLE
    JDBC 2.0 The concurrency mode for a ResultSet object
    that may be updated.Hi,
    do you refer to the following change of code:
    //create a statement object (original)
    Statement stmt = dbConn.createStatement();change to the following:
    //create a statement object (original)
    Statement stmt = dbConn.createStatement(resultSetType,
    resultSetConcurrency);when I use another statement object for executeupdate, what I got was the connection was used by another hstmt. Thus the second column was not updated at all.
    Why?

  • IOS update image every second?

    Hello,
    I am very new to app development, so apologies for the simple questions.
    I have an image on a remote server of which updates every second, now I would like to put that image in a view in an app and have it effectively refresh every second.
    Currently its done using javascript and I just reference the image on the remote server with a time stamp on the end of the image like:
    image.jpg?Tue Jul 03 2012 10:57:08 GMT+0100 (GMT Daylight Time)
    Now I have this working with a local html file and a webview, I just wanted and think it should be possible using native iOS objects like the timer and image view.
    Just not sure how to achieve this.
    Any help is much appreciated.
    Thanks

    Any one?

  • Create data merged document with data on every second page?

    Is it possible to create a data merged document with the variable data only on every second page?
    I have set up the pages with the variable data as a master page (on every odd page) with the text box and paragraph style all set up, and I have set 'override master page items' so the data can be placed, but InDesign seems to freeze up when I try to create the merged document?

    There should be no problem doing the merge with a two-page master and a two-page template document with fields only on one page (and off the top of my head there's no reason to move them off the master page if that's where you put them). I think the problem here is that rachrachm already has a file of 500 pages (based on another thread asking how to apply masters to every other page).
    It's potentially possible to simply place the data file (without the header row) as a text file and auto-flow through the master page frames (can't say for sure without seeing the files), or if the pages without the merge fields are the same just, remove all but the first two pages from the template and do the merge.
    As I metioned earlier, though, this is a very inefficient method of producing that sort of document. A true variable data print flow would be better (you'd need to find a commercial printer who can do it with your data file), or the home version would be to make one single page file for the static content, print 250 copies (plus a few extras, just in case), then make a single page merge template, do the merge, and print that on the back of the already printed pages, or as a separate page. It is immeasurably faster to print multiple copies of a document than it is to print a document that has multiple identical pages.

  • Problem: trying to update all detail rows on pre-commit (MASTER DETAIL FORM

    Hi:
    I got a MASTER DETAIL form... and I need to update every detail row of this form (if the master was updated) before commiting the changes. the problem is that i cannot do that for instance in PRE-COMMIT or ON-COMMIT... it's an "illegal operation". I achieved part of it by coding KEY-COMMIT... but that did not solve the all problem. first take a look of the kind of code i want execute before commiting.
    form trigger key-commit code is is somehow like this:
    DECLARE
    tot_line NUMBER (3);
    line NUMBER (3);
    begin
    IF NAME_IN ('system.form_status') = 'CHANGED'
    THEN
    GO_BLOCK ('DETAIL');
    LAST_RECORD;
    tot_line := GET_BLOCK_PROPERTY ('DETAIL', current_record);
    FIRST_RECORD;
    line:= 1;
    LOOP
    :detail.quant := :detail.quant + 1;
    EXIT WHEN line= tot_line;
    next_record;
    line:= line+ 1;
    END LOOP;
    FIRST_RECORD;
    GO_BLOCK ('MASTER');
    END IF;
    COMMIT;
    end;
    The problem is for instance when the users close form in the "X" button (right top, near minimize form) ... If they do that Forms ask "Do you want to save changes?" ... and with this i do not execute the update of the detail rows...
    But there are other situations when this happens... for instance if EXECUTE_QUERY when i change a record...
    Anyone help?
    Joao Oliveira

    Use PRE-UPDATE trigger (Master block).
    begin
    update <detail_table>
    set quant + 1
    where <detail_table>.<relaition_column1> = :<Master_block>.<relaition_item1>
    and <detail_table>.<relaition_columnN> = :<Master_block>.<relaition_itemN>
    and <detail_block_WHERE>;
    EXCEPTION WHEN OTHERS THEN NULL;
    end;

Maybe you are looking for

  • Any suggestions to improve slow iMac startup?

    My iMac takes about 4 minutes to start up.  I get a grey screen for about 2 minutes, then it takes another 2 minutes to load all the icons.  It seems to have got worse since I upgraded to Mavericks (and to MS Office 2011 at the same time). EtreCheck

  • Logo not printing in classical report

    hello friends, i have displayed logo in classical report but while taking printout its not showing any image in printout. pls suggest. Regards, Sunny

  • Songs bought through voucher no longer authorised with iTune 8

    Hi, Amongst the first iTunes songs I bought along the years were some bought by using a voucher offered to me by a friend. Following an upgrade of my iMac to Leopard 10.5.5 and getting iTune 8.0.1 I've had to resync my iPod. Since then I have 41 song

  • Hp officejet 8600 fax send failed

    This is a new HP 8600 that I bought a while ago and set up. it has never faxed and now I'm a little up set. I have FIOS and I have a DSL filter on the phone end. It dials and the other phone with go to tone but my machine won't handshake and connect.

  • Difference b/w Weblogic and SOA

    Hi, Can anyone briefly differentiate between Weblogic & SOA?? Thanks,