How to update  the restricted rows that were selcted using fetch

Hi
I have to fetch  one row at a time from my staging table using JDBC Sender Adapter,  which is configured against AS400 DB2 and push it to R/3.
The select  SQL looks like this in JDBC Sender Adapter
     <b>select  jedata, oxruns from fxjrnep2 where oxsts=' '   fetch first 1 rows only</b>
                                   and
update sql is
     <b>update suplib.FXJRNEP2 set OXSTS='SUC' where OXSTS=' ' </b>
The problem here is my select gets one row, which is what i want, but my update actually updates all the rows that satisfied the where condition oxsts=' ' instead of one.
  I couldn't  use <b>fetch first 1 rows only</b> at the end of the update sql to update the selected row. DB2 does not allow  fetch in update sql.
Can anyone suggest solution here or recommend alternative?
Best Regards
Venkat

check for update query where u can club the select stmt u had used with udpate like:
update suplib.FXJRNEP2 set OXSTS='SUC' where OXSTS = (select jedata, oxruns from fxjrnep2 where oxsts=' ' fetch first 1 rows only
just need to try combinations of this type.
if still this is not working use a bpm and get all the records where OXSTS is null and process record one by one within a block

Similar Messages

  • How to update the test case result in MTM using C#

    Hi
    I have tried the following code but when I execute the same I am getting the testcase result as "In Progress".
    How to update the testcase execution result as Passed.
    I tried the below code:
    public
    static
    void UpdateResult()
    TfsTeamProjectCollection tfs =
    new
    TfsTeamProjectCollection(TfsTeamProjectCollection.GetFullyQualifiedUriForName(server));
    ITestManagementService tms = tfs.GetService<ITestManagementService>();
    ITestManagementTeamProject proj = tms.GetTeamProject(project);
    ITestPlan Plan = proj.TestPlans.Find(1);
    ITestRun testRun = proj.TestRuns.Create();
    testRun = Plan.CreateTestRun(false);
    ITestPointCollection points = Plan.QueryTestPoints("SELECT
    * FROM TestPoint");
    foreach (ITestPoint
    p in points)
    testRun.AddTestPoint(p,Plan.Owner);// null);
    testRun.State = TestRunState.Completed;
    testRun.Save();
    ITestCaseResultCollection results = testRun.QueryResults();
    ITestIterationResult iterationResult;
    foreach (ITestCaseResult
    result in results)
    iterationResult = result.CreateIteration(1);
    foreach (ITestStep
    testStep in result.GetTestCase().Actions)
    ITestStepResult stepResult = iterationResult.CreateStepResult(testStep.Id);
    stepResult.Outcome = TestOutcome.Passed;   
    iterationResult.Actions.Add(stepResult);
    iterationResult.Outcome = TestOutcome.Passed;
    result.Iterations.Add(iterationResult);
    result.Save();
    results.Save(true);
    testRun.Save();
    testRun.Refresh();

    Hi Mohammed,
    Sorry for my delay.
    According to your code, I have been modified your code in my side and it can work fine. So you can refer the following code to check your issue in your side.
    Reference:
    publicstaticvoidUpdateResult()
    TfsTeamProjectCollectiontfs
    = newTfsTeamProjectCollection(TfsTeamProjectCollection.GetFullyQualifiedUriForName(server));
    ITestManagementServicetms
    = tfs.GetService<ITestManagementService>();
    ITestManagementTeamProjectproj
    = tms.GetTeamProject(project);
    ITestPlanPlan = proj.TestPlans.Find(1);
    IStaticTestSuitesuite
    = Plan.RootSuite.SubSuites.Where(s
    => s.Id == 1339).First()
    asIStaticTestSuite;
    ITestCasetestcase
    = null;
    testcase
    = suite.Entries.Where(e
    => e.Title == "login").First().TestCase;
    ITestRuntestRun
    = project.TestRuns.Create();
    testRun
    = Plan.CreateTestRun(false);
    ITestPointCollectionpoints
    = Plan.QueryTestPoints("SELECT * FROM TestPoint WHERE TestCaseId ="+
    testcase.Id);
    foreach(ITestPointp
    inpoints)
    testRun.AddTestPoint(p,
    Plan.Owner);// null);
    //testRun.AddTestPoint(p, null);
    testRun.State =
    TestRunState.Completed;
                testRun.Save();
    ITestCaseResultCollectionresults
    = testRun.QueryResults();
    ITestIterationResultiterationResult;
    foreach(ITestCaseResultresult
    inresults)
                    iterationResult = result.CreateIteration(1);
    foreach(ITestSteptestStep
    inresult.GetTestCase().Actions)
    ITestStepResultstepResult
    = iterationResult.CreateStepResult(testStep.Id);
                        stepResult.Outcome
    = TestOutcome.Passed;   
                        iterationResult.Actions.Add(stepResult);
                    iterationResult.Outcome
    = TestOutcome.Passed;
    result.Iterations.Add(iterationResult);
    result.Outcome
    = TestOutcome.Passed;
    result.State = TestResultState.Completed;
    result.Save(true);
    testRun.Save();
    testRun.Refresh();
    Note: you will need to
    base on your requirement to modify the code such as modify the testsuite id and title in your side.
    In addition, I find a blog about TFS API that can help you:
    # Code snippets on Test Management APIs
    http://blogs.msdn.com/b/aseemb/archive/2012/08/07/code-snippets-on-test-management-apis.aspx
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get the vendor number that was created using xk01..?

    Suppose i am creating a vendor with all the information by using a bdc program.
    In the same program if i want to go to the XK02 of that particular vendor that was created recently....how it possible..?
    Means how to get that particular vendor number that was created recently...?

    Hi...
    You Can Get the Vendor number after Calling the Transaction 'XK01' as below.
    <b>Declare a table for Collecting messages :</b>
    DATA: T_MSG TYPE TABLE OF BDCMSGCOLL,
              WA_MSG TYPE  BDCMSGCOLL.
    <b>Then Call Transaction Statment:</b>
    CALL TRANSACTION 'XK01'
               USING T_BDCDATA
               MODE 'N'
               MESSAGES INTO t_msg.
    if sy-subrc = 0.
      READ TABLE T_MSG INTO WA_MSG WITH MSGTYP = 'S'.
                                                                    MSGID = 'F2'
                                                                    MSGNR =  '175'.
    <b>Note: Bcoz the XK01 will issue this message</b>
      if sy-subrc = 0.
      write: / WA_MSG-MSGV1.  "This will contrain Vendor Number
    endif.
    endif.
    And you can also Try the Other method i.e. after the Call transaction statement
    <b> GET PARAMETER ID 'LIF' field V_LIFNR.
      WRITE:/ V_LIFNR.</b>
    Reward if Helpful.

  • HELP! How te retrieve the last row in MYSQL database using Servlet!

    Hi ,
    I am new servlets. I am trying to retireve the last row id inserted using the servlet.
    Could someone show me a working sample code on how to retrieve the last record inserted?
    Thanks
    MY CODE
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class demo_gr extends HttpServlet {
    //***** Servlet access to data base
    public void doPost (HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException
         String url = "jdbc:mysql://sql2.njit.edu/ki3_proj";
              String param1 = req.getParameter("param1");
              PrintWriter out = resp.getWriter();
              resp.setContentType("text/html");
              String semail, sfname, slname, rfname, rlname, remail, message;
              int cardType;
              sfname = req.getParameter("sfname");
              slname = req.getParameter("slname");
              rfname = req.getParameter("rfname");
              rlname = req.getParameter("rlname");
              semail = req.getParameter("semail");
              remail = req.getParameter("remail");
              message = req.getParameter("message");
              //cardType = req.getParameter("cardType");
              cardType = Integer.parseInt(req.getParameter("cardType"));
              out.println(" param1 " + param1 + "\n");
         String query = "SELECT * FROM greeting_db "
    + "WHERE id =" + param1 + "";
              String query2 ="INSERT INTO greeting_db (sfname, slname ,semail , rfname , rlname , remail , message , cardType ,sentdate ,vieweddate) values('";
              query2 = query2 + sfname +"','"+ slname + "','"+ semail + "','"+ rfname + "','"+ rlname + "','"+ remail + "','"+ message + "','"+ cardType + "',NOW(),NOW())";
              //out.println(" query2 " + query2 + "\n");
              if (semail.equals("") || sfname.equals("") ||
              slname.equals("") || rfname.equals("") ||
              rlname.equals("") || remail.equals("") ||
              message.equals(""))
                        out.println("<h3> Please Click the back button and fill in <b>all</b> fields</h3>");
                        out.close();
                        return;
              String title = "Your Card Has Been Sent";
              out.println("<BODY>\n" +
    "<H1 ALIGN=CENTER>" + title + "</H1>\n" );
                   out.println("\n" +
    "\n" +
    " From  " + sfname + ", " + slname + "\n <br> To  "
                                            + rfname + ", " + rlname + "\n <br>Receiver Email  " + remail + "\n<br> Your Message "
                                            + message + "\n<br> <br> :");
                   if (cardType ==1)
                        out.println("<IMG SRC=/WEB-INF/images/bentley.jpg>");
                   else if(cardType ==2) {
                        out.println("<IMG SRC=/WEB-INF/images/Bugatti.jpg>");
                   else if(cardType ==3) {
                        out.println(" <IMG SRC=/WEB-INF/images/castle.jpg>");
    else if(cardType ==4) {
                        out.println(" <IMG SRC=/WEB-INF/images/motocross.jpg>");
    else if(cardType ==5) {
                        out.println(" <IMG SRC=/WEB-INF/images/Mustang.jpg>");
    else if(cardType ==6) {
                        out.println("<IMG SRC=/WEB-INF/images/Mustang.jpg>");
    out.println("</BODY></HTML>");
         try {
              Class.forName ("com.mysql.jdbc.Driver");
              Connection con = DriverManager.getConnection
              ( url, "*****", "******" );
    Statement stmt = con.createStatement ();
                   stmt.execute (query2);
                   //String query3 = "SELECT LAST_INSERT_ID()";
                   //ResultSet rs = stmt.executeQuery (query3);
                   //int questionID = rs.getInt(1);
                   System.out.println("Total rows:"+questionID);
    stmt.close();
    con.close();
    } // end try
    catch (SQLException ex) {
              //PrintWriter out = resp.getWriter();
         resp.setContentType("text/html");
              while (ex != null) { 
         out.println ("SQL Exception: " + ex.getMessage ());
         ex = ex.getNextException ();
    } // end while
    } // end catch SQLException
    catch (java.lang.Exception ex) {
         //PrintWriter out = resp.getWriter();
              resp.setContentType("text/html");     
              out.println ("Exception: " + ex.getMessage ());
    } // end doGet
    private void printResultSet ( HttpServletResponse resp, ResultSet rs )
    throws SQLException {
    try {
              PrintWriter out = resp.getWriter();
         out.println("<html>");
         out.println("<head><title>jbs jdbc/mysql servlet</title></head>");
         out.println("<body>");
         out.println("<center><font color=AA0000>");
         out.println("<table border='1'>");
         int numCols = rs.getMetaData().getColumnCount ();
    while ( rs.next() ) {
              out.println("<tr>");
         for (int i=1; i<=numCols; i++) {
    out.print("<td>" + rs.getString(i) + "</td>" );
    } // end for
    out.println("</tr>");
    } // end while
         out.println("</table>");
         out.println("</font></center>");
         out.println("</body>");
         out.println("</html>");
         out.close();
         } // end try
    catch ( IOException except) {
    } // end catch
    } // end returnHTML
    } // end jbsJDBCServlet

    I dont know what table names and fields you have but
    say you have a table called XYZ which has a primary
    key field called keyID.
    So in order to get the last row inserted, you could
    do something like
    Select *
    from XYZ
    where keyID = (Select MAX(keyID) from XYZ);
    Good Luckwhat gubloo said is correct ...But this is all in MS SQL Server I don't know the syntax and key words in MYSQL
    This works fine if the emp_id is incremental and of type integer
    Query:
    select      *
    from      employee e,  (select max(emp_id) as emp_id from employee) z
    where      e.emp_id = z.emp_id
    or
    select top 1 * from employee order by emp_id descUday

  • HT1727 I inherited my iPhone & I don't know how to update the 45 apps already on it

    I inherited my iPhone from my husband so most of the apps are under his old Apple ID/business email account but his email account is no longer accessable since he has recently retired and no longer can use his business account.  I don't know how to update the 45 apps that he purchased that are still on my phone.

    Hi barbsapplesupport!
    Here is a link that can tell you about updating your apps on your iPhone:
    Download and install app updates - App Store - iPhone Basics - Apple Support
    http://support.apple.com/kb/TI133
    It is likely that these apps were purchased under his Apple ID, so in order to update them, you will need to enter his Apple ID and password when prompted. Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • How to update the payload of a BPEL process instance

    Hi I have another question.
    How do I update the payload of a BPEL process instance without the activity being a Human Task. I know there are ton's of example showing how to update the payload of a user task using BPEL API's. But in my case I need to update the payload of a BPEL process instance which has no human task.

    Thanks
    For confirming that the payload in the BPEL process instance is read-only. Now I can see what alternatives I come up with besides the DB save option.
    Guys if you can take the time to answer/comment on another question I have posted in this forum that will be great
    here is the link
    Multi step Human Task
    Regards,
    Jayesh Nazre
    MCSD, MCSE, SCJP, PMP

  • How to find BEx queries that were not used along with no of times executed

    Hi SDN,
    I need build a query which shows the BEx reports that were not used and also the number times the query was executed.
    I built the query on "multiprovider 0TCT_MC01" in which I used the KF "0TCTQUCOUNT" then the query is not capturing this information, while executing from Portal. ( as stated in /thread/716593 [original link is broken]).
    If anybosy happen to know the solution please share.
    Also
    as stated in this link (BW 3.5 Statistics - User Hits)
    Is there any infoobject which has the exact functionality as of the "0TCTNAVCTR" of 0BWTC_C02 (we can not use 0BWTC_C02 as we are in BW 7 SP16).
    I think it is very well known issue but there is not any exact solution to it if anybody finds the solution please update this points will be assigned
    Thank you,
    Prasaad
    Edited by: Prasaadbw on Mar 18, 2010 2:01 PM

    Hi,
    Try from one of these tables RSZRANGE, RSZELTXREF,
    RSZELTTXT,RSRREPDIR,RSZSELECT,RSZCOMPDIR.
    There is a field 'Last Used'.
    You can get some info when Query was used last
    -Vikram

  • How to update the identity_column value in sql server 2008

    Hi Team,
    I have identity column based table. In the table i use insert the name as per the requirement and for ID i use to set the identity now i need to update the particular row id.
    when i use to trying i'm getting the below error.
    Msg 8102, Level 16, State 1, Line 4
    Cannot update identity column 'CategoryID'.
    Kindly help me out regarding this.
    Thanks & Regards,
    Ramesh R

    You cannot update an IDENTITY column. You need to move the data into another table make  the changes over there  and insert the back the data into original table.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • To find out the last row that is updated in a View Object

    Hi OAF Gurus,
    I have requirement like,
    I have to find out the last row that is updated on a particular View Object and I have send a mail to the users about the change.
    JegSAMassMobVOImpl vo = getJegSAMassMobVO1();
    JegSAMassMobVO is the View Object Name and it displays certain rows that has already been added to the VO in the Page.
    Now the issue is when a user updates a particular row,I have to find which row gets updated and have to send a email to that particular employee about the change.
    Just want to know,how to find out the last updated row in a particular VO.
    Any Help would be appreciated as this a immediate requirement.
    Regards,
    Magesh.M.K.
    Edited by: user1393742 on May 4, 2011 1:06 AM

    Hi Magesh
    It shoud be a Advanced table ,so when user will update the row ,the specific row will fire the PPR and on that event u can capture the row using row reference ,this is the sample code below
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean); OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if ("<ItemPPREventName>").equals(event))
    // Get the identifier of the PPR event source row
    String rowReference =
    pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Serializable[] parameters = { rowReference };
    // Pass the rowReference to a "handler" method in the application module.
    262
    am.invokeMethod("<handleSomeEvent>", parameters);
    In your application module's "handler" method, add the following code to access the source row:
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    Thanks
    Pratap

  • How to restore points in apps that were erased by this god awful update?

    How to restore points in apps that were there before this god awful update?

    This wonderful update wouldn't effect any of this if you backed-up properly to iCloud or restored after the update. I didn't lose anything in my update.

  • Random selection of rows from a 2D array then subset both the rows that were selected and those that were not. Please see message below.

    For example, I have a 2D array with 46 rows and 400 columns. I would like to randomly select 46 data rows from the 2D array. By doing the random selection it means that not all individual 46 rows will be selected some rows may appear more than once as there may be some duplicates or triplicates in the random selection. The importan thing is that we will have randomly selected 46 rows of data (no matter that some rows appear more than once). Then I would like to subset these randomly selected 46 data rows (some which will be duplicated, or triplicated, etc.) and then also find and subset the rows that were not selected. Does this make sense? Then i would like to do this say 10 times for this data set. So that then I will have 2 by 10 data sets: the first 10 each with 46 rows and the other 10 with n rows depending on how many WERE NOT randomly selected. i hope that my explanation is clear. I am relatively new to Labview. It is really great so I am getting better! If anyone can help me with this problems it will be great. RVR

    Start by generating randon #s between 0 and 45. Run a for loop X times and in it use the random function, multiply the result by X and round down (-infinity). You can make this into a subVI, which you can reuse later. In the same loop, or in a different one, use Index Array to extract the rows which were selected (wiring the result out of the loop with auto indexing causes it to be rebuilt into a 2D array).
    One possible solution for the second part would be to go over the array of randomly generated numbers in a for loop and use Search 1D Array to find each of the numbers (i). If you get -1, it means the row wasn't selected and you can extract it.
    I hope this puts you on the right path. If not, don't be afraid to ask more.
    To learn more about LV, I suggest you read the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide.
    Try to take over the world!

  • How can I view my pictures that were backed up to iTunes? I no longer have an apple product but need to view the pictures for very important reasons.

    How can I view my pictures that were backed up to iTunes? I no longer have an apple product but need to view the pictures for very important reasons.

    If you mean backed up as part of an iPhone backup in iTunes?  If so, you would have to use 3rd party software to extract them from the backup, such as iPhone Backup Extractor.

  • HT1918 I cancelled a payment through PayPal. How do I update the payment for that charge?  I looked at my payment information and it has my credit card information.  I'm not sure where to update the PayPal part of payment.

    I cancelled a payment through PayPal. How do I update the payment for that charge?  I looked at my payment information and it has my credit card information.  I'm not sure where to update the payment that was associated with my PayPal account?  I am not sure what that paid for?  I am trying to process updates on my IPhone &amp; IPad for apps. I have already downloaded. 

    Hi Xellana, and a warm welcome to the forums!
    I'm looking for information and pricing on possibly upgrading the processor from the PowerPC to Intel.
    While anything is possible if you had enough money... NOPE, you can't change the CPUs to Intel, nor can you get any faster PPC upgrades for it. It'd be far cheaper to buy a new IntelMac than to replace everything inside the G5, and I mean just about everything, then figure out how to machine the case & such to mount Intel Logic Board, Graphic Card & such.
    Sorry.

  • HT1727 How can i retrieve purchased audiobooks that were not synced (problem encountered during sync process).  My account shows the purchase history, but the apps are no longer displayed in itunes or on my ipad or iphone

    How can i retrieve purchased audiobooks that were not synced (problem encountered during sync process)?  My account shows the purchase history, but the apps are no longer displayed in itunes or on my ipad or iphone.  I'm not very savvy with using iTunes - I don't think is very intuitive (unlike me:)).  Any help would be appreciated.
    Thanks

    Hello mcegirl4,
    Thanks for using Apple Support Communities.
    Please refer to the instructions in the following article to assist in downloading those previous purchases from iTunes and the App Store:
    Download past purchases
    http://support.apple.com/kb/HT2519
    Take care,
    Alex H.

  • My iPhone was stolen.  How do I retrieve the pictures etc that were on imt.  I know they must be in the iCloud but I don't know how to get into it from my iPad.  Also, I would like to try to locate the phone ...how do I do that from my iPad?

    My iPhone was stolen.  How do I retrieve the pictures etc that were on imt.  I know they must be in the iCloud but I don't know how to get into it from my iPad.  Also, I would like to try to locate the phone ...how do I do that from my iPad?

    These links may be helpful.
    How to Track and Report Stolen iPad
    http://www.ipadastic.com/tutorials/how-to-track-and-report-stolen-ipad
    Reporting a lost or stolen Apple product
    http://support.apple.com/kb/ht2526
    Report Stolen iPad Tips and iPad Theft Prevention
    http://www.stolen-property.com/report-stolen-ipad.php
    How to Find a Stolen iPad
    http://www.ehow.com/how_7586429_stolen-ipad.html
    Oops! iForgot My New iPad On the Plane; Now What?
    http://online.wsj.com/article/SB10001424052702303459004577362194012634000.html
     Cheers, Tom

Maybe you are looking for

  • Support direct3D graphics, 3D PDF toolkit

    It would be nice if in Acrobat's 3D tools, it would support both OpenGL graphics based models and Direct3D graphics based models. I use Autodesk Inventor 2011 as my 3D application.  Adobe does support some Inventor files, but none after about the 200

  • Firefox cannot download any Flash content using Mac OS Lion

    I am running Mac OS Lion (10.7) and FF 4.01 and 5 (on another Mac). I have both Flash & Video Download and Flash Video Downloader - neither works. It downloads a file showing nothing by gibberish (code).

  • Resizing a movie in a window and it's sprites

    I'm working on a kind-of slide show project. The 'show' runs in a resizable window. The projector (created with Director v10) has a lot of sprites (>60). Most of them should not be resized and should stay at a fixed position (e.g. at the right margin

  • Windows Photoshop Elements to Mac Version

    I bought Photoshop Elements for a Windows based laptop, but I've recently bought a Mac and want to transfer my purchase my to my Mac. However my serial number does not work. Am I able to transfer a purchase from Windows to Mac? Thanks in advance for

  • Important: I need help please

    Hi guys, I have bought a geforce 4 Ti 4200 VTD 8X 128 MB DDR 4 months ago. I really love it and don't want to mess up any part of my Pc by over clocking etc. SO I never overclock my video card. Now the issue is: 1) Today I installed MSI 3d experience