UPDATE QUERY IN JDBC

Hi,
i am trying to update data in database but its not getting updated.can anyone tell me the solution for this.
can i get a link which involves updating data in database.

Hi,
You can use the following statement
Update SQL Statement : Update student set readflag = 'Y' where readflag = 'N'
Folloow the receiver JDBC Structure as follows
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Regards
Seshagiri

Similar Messages

  • Update query in JDBC adapter

    Hi guys help me with this
    1) What is the use of update query in jdbc adapter?
    2) Why do we use the flag field in jdbc table ?

    Hi,
    1) What is the use of update query in jdbc adapter?
    The purpose of the Update Query in JDBC is to change the status of the processed records in the table.
    That is when JDBC query is executed  it select the records from the table in the Database and it sends to the Receiver.
    After that it executes the Update query to change the status of the processed records in the Table.
    2) Why do we use the flag field in jdbc table ?
    Flag field in the table is used to identify which record is processed by Jdbc adapter. Initial stage it will have the status as 0 , if it is successfully processed then it will updated to 1.
    Based on this we can identify processed records which is done by update query.
    Regards
    Sridhar Goli

  • Not comitting database after the update query in jdbc

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

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

  • Sender jdbc adapter - no update query

    hi ,
    i am using pi 731 single stack.
    the scenario is - PI has to pick data from view of a hana database. i am using jdbc sender for it.
    pi will not have access to update the table,only pi can read the view of database.So,PI can't use UPDATE query.
    If in jdbc sender channel ,I use SELECT query only and no UPDATE query - will it work ? what will happen if there are 100 records in the view and PI failed after fetching 43 records..will it pick from 44th record next time OR it will start from 0 again ?
    rgds

    Hi SAP PI,
    It has no sense to use the sender JDBC without update query because then always will be taken the same records.
    If you cant update the source DB you only have the choice to talk with the DB administrators that they develop for you a stored procedure that it has to do the work to get different records in every PI access.
    If the PI record process fail with impossible source database update update, the only way (afaik) is to do a PI alert and to communicate it to db sender administrators. There are another option like to store the data in a intermediate table, and so on but all possibilities that i can think now are not to enough good.
    Regards.

  • Update query not working in the JDBC sender Communication channel

    Hi,
    We are working on JDBC to File scenario. As per the configuration, XI should pick the data from SQL database every 20 secs and should update the corresponding flag. We are using subquery in the select and update statement as both header and detail tables are involved.
    Now the issue is, select query is working fine but update statement is not working as expected. It is somehow updating some other records rather than doing for the ones selected by the adapter.
    Moreover logSQLstatement is also not working. Hence we are unable to identify the records which are getting updated.
    Please advise.

    Hi Rumi,
    See Question 8. Transaction Handling (Sender) in [SAP Note 831162 - FAQ: XI 3.0 / PI 7.0 / PI 7.1 JDBC Adapter|https://websmp130.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=831162].
    8.  Transaction Handling (Sender)
    Q: If I have the following configured in a JDBC Sender:
    Select Query:
    SELECT column FROM TABLENAME WHERE FLAG = "TRUE"
    Update Query:
    UPDATE TABLENAME SET FLAG = "FALSE" WHERE FLAG = "TRUE"
    How do I know that the JDBC adapter will not update newly added rows (rows that were
    added between the time that the SELECT and UPDATE queries were executed) that were
    not read in the initial SELECT query?
    A: The SELECT and the UPDATE are run in the same DB transaction, i.e. both statements
    have the same view on the database.
    Make sure that both statements use the same WHERE clause. An additional
    requirement for the correct operation of this scenario is the configuration of
    an appropriate transaction isolation level on the database
    (i.e., repeatable_read or serializable). You might also consider using a
    "SELECT FOR UPDATE" statement instead of a plain SELECT statement to
    ensure proper locking on the database. "SELECT FOR UPDATE"
    is not supported in MS SQL database. In this case please make use of an
    appropriate transaction isolation level on the database. For more details
    please contact your DB vendors.
    After, see Transaction Handling Issues in [SAP Note 1039779 - JDBC Adapter issues(Escape character,Transaction handling)|https://websmp130.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1039779].
    Best Regards.
    Pedro Baroni

  • JDBC Sender Update Query

    Does anyone know, in case of Sender JDBC adapter, how is the below handled:
    Say we have the Select Query as below:
    SELECT date FROM TABNAME where FLAG = "TRUE"
    and the update query as below:
    UPDATE TABNAME SET FLAG = "FALSE" where FLAG = "TRUE"
    How do we know whether the adapter will not update the newly added rows (between the times the Select and Update queries were executed) that were not read in the corresponding Select Query.

    Hi,
    We had a similar situation and following description tells you how we handled it:
    1.DB Job was created and scheduled to run at regular intervals which changes the status of the records from FLAG = "TRUE" to an intermediate status, say for e.g. FLAG = "INTM".
    2.Select and update statements were written as follows:
    For e.g.
    SELECT date FROM TABNAME where FLAG = "INTM"
    UPDATE TABNAME SET FLAG = "FALSE" where FLAG = "INTM"
    This solution is running in our Production environment smoothly.
    Question of maintenance of these DB jobs comes into play.But its upto you to decide !!
    Hope it helps !
    Regards,
    Sridhar

  • Sender jdbc adapter....update query?

    Dear Team,
    we are selecting date from master database and client dont want to add any other field for update query.
    using select option, how to avoid selecting duplication records.
    can i use current date and time for selecting the records for every select statement?
    if yes then how to do it and what we need to update in update query??
    Regards,
    Chinna

    Hi Chinna,
    Check like this below.
    The following SQL statement selects the product name, and price for today from the "Products" table:
    SELECT ProductName, Price, Now() AS PerDate
    FROM Products;
    Similarly,
    UPDATE ProductName, Price, Now() AS PerDate
    FROM Products;
    Regards,
    Loordh.

  • Update query not working from edit page

    Next incident with the guestbook saga:
    Successful execution of gb_entry_mstr_det_e.cfm with URL:
    http://www.benoitsystems.com/ww/bd/gb/gb_entry_mstr_det_e.cfm?call_number=14 all have database current info...this is good, but:
    textboxes
    Problem 1:
    the SELECT field does not does not reflect/display the correct option I know exists in the database
    the database field whence this SELECT object is supposed to display is a number, not text.
    now,...
    Problem 2:
    Clicked on "Update Your Entry" button at bottom of edit page (to update by going to gb_confirm_update.cfm)
    <INPUT
    TYPE="submit"
    NAME="submit"
    VALUE="Update Your Entry">
    then, arriving at the gb_confirm_update.cfm page, ...
    Got an error (below) executing the page: gb_confirm_update.cfm with resulting URL:
    http://www.benoitsystems.com/ww/bd/gb/gb_confirm_update.cfm?call_number=#gb_entryID#
    --- snippet from template gb_confirm_update.cfm
    <CFQUERY DATASOURCE="9130.ww" NAME="ww_gb_ud">
    UPDATE gb_entries
    SET
    gb_entry_stts_='form.gb_entry_stts_',
    gb_entry_nm_f='form.gb_entry_nm_f',
    gb_entry_nm_l='form.gb_entry_nm_l',
    gb_entry_nm_l_dspl_x=form.gb_entry_nm_l_dspl_x,
    gb_entry_tce='form.gb_entry_tce',
    gb_entry_tce_dspl_x=form.gb_entry_tce_dspl_x,
    gb_entry_cy='form.gb_entry_cy',
    gb_entry_stt='form.gb_entry_stt',
    gb_entry_instr='form.gb_entry_instr',
    gb_entry_m='form.gb_entry_m',
    gb_entry_del_x=form.gb_entry_del_x
    WHERE gb_entryID=form.gb_entryID
    </CFQUERY>
    --- end snippet ---
    =================================================
    Error Executing Database Query. 
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4. 
    The error occurred in E:\benoitsystems.com\wwwroot\ww\bd\gb\gb_confirm_update.cfm: line 2
    1 : <!--- <CFUPDATE DATASOURCE="9130.ww" TABLENAME="gb_entries"> --->
    2 : <CFQUERY DATASOURCE="9130.ww" NAME="ww_gb_ud">
    3 : UPDATE gb_entries
    4 : SET
    SQL    UPDATE gb_entries SET gb_entry_stts_='form.gb_entry_stts_', gb_entry_nm_f='form.gb_entry_nm_f', gb_entry_nm_l='form.gb_entry_nm_l', gb_entry_nm_l_dspl_x=form.gb_entry_nm_l_dspl_x, gb_entry_tce='form.gb_entry_tce', gb_entry_tce_dspl_x=form.gb_entry_tce_dspl_x, gb_entry_cy='form.gb_entry_cy', gb_entry_stt='form.gb_entry_stt', gb_entry_instr='form.gb_entry_instr', gb_entry_m='form.gb_entry_m', gb_entry_del_x=form.gb_entry_del_x WHERE gb_entryID=form.gb_entryID 
    DATASOURCE   9130.ww
    VENDORERRORCODE   -3010
    SQLSTATE   07002
    Please try the following:
    Check the ColdFusion documentation to verify that you are using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.
    Browser   Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Remote Address   71.233.234.226
    Referrer   http://www.benoitsystems.com/ww/bd/gb/gb_entry_mstr_det_e.cfm?call_number=14
    Date/Time   21-Jul-10 03:11 PM
    =================================================
    I have every NAME of each object matching, verbatum, in the UPDATE query, and every database field name correct in teh query also.

    I was encouraged to send snippets in an another submission, and now I believe it is best that I  "lay my cards on the table"
    Here's my hand:
    Pages in question for your review:
    http://www.benoitsystems.com/ww/bd/gb/gb_mstr.cfm  click on the pencil (the toilet will delete the record.
    http://www.benoitsystems.com/ww/bd/gb/gb_entry_mstr_det_e.cfm?call_number=21  go to bottom of webpage and click “Update Your Entry”
    http://www.benoitsystems.com/ww/bd/gb/gb_confirm_update.cfm?call_number=#gb_entryID#
    In your review of the above (should you choose) before clicking on the pencil, look at the status on the master listing record you will be editing, and feel free to edit.  Most statuses will be “Hold”
    Two dummy MS Access database tables:
    Table 1: "gb_entries" (Guestbook)
    field 1: gb_entries_ID (Autonumber - Long Integer)
    field 2: gb_entries_dt (date/time)
    field 3: gb_entries_nm_f (Text)
    field 4: gb_entries_nm_l (Text)
    field 5: gb_entries_nm_stts_ (Number field - Byte (not bit)) (fed by gb_sttsID)
    couple other text fields
    field 6: gb_entries_em (Text)
    field 7: gb_entries_cy (Text)
    field 8: gb_entries_stt (Text)
    field 9: gb_entries_nm_l_dspl (Yes/No or True/False)
    field 10: gb_entries_m (Memo type)
    Table 2: "gb_stts_rf" (Guestbook Status Reference)
    field 1: gb_sttsID (Autonumber - Long Integer)
    field 2: gb_stts (Text)
    Two Templates:
    This is the edit page (where a person with administrative access may edit the status or change the spelling for someone, etc.):
    <!--- This query fills the form with the chosen record data (except for the darned SELECT object) ---> <CFQUERY NAME="edit_entry" DATASOURCE="9130.ww"> SELECT * FROM gb_entries WHERE #call_number#=gb_entryID </CFQUERY>
    <!--- This query is for the select dropdown of guestbook status options (set to default on “Hold” from gb_nw.cfm) ---> <CFQUERY NAME="q_stts" DATASOURCE="9130.ww"> SELECT * FROM gb_stts_rf </CFQUERY>
    <HTML>
    <HEAD>
    <TITLE>Woodwindology Guestbook Entry Edit Page</TITLE> <CFOUTPUT QUERY="incl_css_bd">#incl_code#</CFOUTPUT>
    </HEAD>
    <BODY
          BGPROPERTIES="fixed">
    <DIV ALIGN="center">
    <IMG
          SRC="<CFOUTPUT>#baseurl#</CFOUTPUT>md/img/ut/ttl/pg/guestbook.gif"
          BORDER="0">
    <BR>
    <IMG
          SRC="<CFOUTPUT>#baseurl#</CFOUTPUT>md/img/ut/ttl/sub/edit_entry.gif"
          BORDER="0">
    <BR>
    Developer View
    </DIV>
    <TABLE>
          <TR>
                <TD>
                      <TABLE
                            WIDTH="100%"
                            BORDER="0"
                            CELLPADDING="5"
                            CELLSPACING="0">
          <TR>
                <TD VALIGN="top">
                      <FORM
                            NAME="f_gb_entry_mstr"
                            ACTION="gb_confirm_update.cfm?call_number=#gb_entryID#"
                            METHOD="post">
                      <CFOUTPUT QUERY="edit_entry">
                      <B>Entry ID:</B>
                      #gb_entryID#     
                      <INPUT
                            TYPE="hidden"
                            NAME="gb_entryID"
                            VALUE="#gb_entryID#">
                      <P>
                      <B>Entry Date and Time:</B>
                      #DateFormat("#gb_entry_dt#","mmmm d, yyyy")# #TimeFormat("#gb_entry_dt#","h:mm tt")#
    <P>
                      <B>Entry Status:</B>
                      <SELECT
                            NAME="gb_entry_stts_"
                            VALUE="#gb_entry_stts_#">
    </CFOUTPUT>
                            <CFOUTPUT QUERY="q_stts">
                                  <OPTION VALUE="#gb_sttsID#">#gb_stts#</OPTION>
                            </CFOUTPUT>
                      </SELECT>
                      <P>
    <CFOUTPUT QUERY="edit_entry">
                      <B>Guest's First Name:</B>
                      <INPUT
                            TYPE="text"
                            NAME="gb_entry_nm_f"
                            VALUE="#gb_entry_nm_f#">
                      <P>
                      <B>Guest's Last Name:</B>
                      <INPUT
                            TYPE="text"
                            NAME="gb_entry_nm_l"
                            VALUE="#gb_entry_nm_l#">
                      <BR>
                      Display Last Name:
                      <INPUT
                            TYPE="radio"
                            NAME="gb_entry_nm_l_dspl_x"
                            VALUE="Yes">
                      Do Not Display Last Name:
                      <INPUT
                            TYPE="radio"
                            NAME="gb_entry_nm_l_dspl_x"
                            VALUE="no">
                            <P>
                            <B>Your Email Address:</B><BR>
                            <INPUT
                                  TYPE="text"
                                  NAME="gb_entry_tce"
                                  VALUE="#gb_entry_tce#"
                                  SIZE="40"
                                  MAXLENGTH="40">
                      <BR>
                      Uncheck the box to keep email private:
                      <INPUT
                            TYPE="checkbox"
                            NAME="gb_entry_tce_dspl_x"
                            VALUE="#gb_entry_tce_dspl_x#">
                      <P>
                      <SPAN CLASS="emph01">*</SPAN> Your City:
                      <INPUT
                            TYPE="text"
                            NAME="gb_entry_cy"
                            VALUE="#gb_entry_cy#"
                            SIZE="30">
                      <P>
                      <SPAN CLASS="emph01">*</SPAN> Your State:
                      <INPUT
                            TYPE="text"
                            NAME="gb_entry_stt"
                            VALUE="#gb_entry_stt#"
                            SIZE="30">
                      <BR>
                            <B>Instruments Played:</B>
                      <BR>
                            <TEXTAREA
                                  COLS="45"
                                  MAX="50"

  • WHEN DOES UPDATE  HAPPEN IN JDBC SENDER Adapater

    Hi folks ,
    I am using jdbc sender adapater to call RFC function and the o/p pf the RFC i am writing to the file
    This is my select query
    SELECT * FROM ULIDTA2.F5631505 WHERE QSINTF='N'
    and mu update query is
    Update ULIDTA2.F5631505 set QSINTF='Y' where QSINTF='N'
    now the slect returns multiple rows and  i  want the rfc to be called depending on the number of rows i get 4m select . but wht is happening is i find that seleect picks the first row calls the rfc writes to the file and updates the query .
    hence other rows are not able to be processed .
    does jdbc sender update as soon as it picks the select query . how do i update one row at a time .
    thks
    amit

    Hi Amit,
    I dont think one row at a time is possible with the SELECT query as the JDBC adapter is going to return all the rows that satisfy your query.
    One work around would be to develop a Stored Procedure in your Datbase, and then use the same Stored Procedure as your select query. Now, tits the task of the stored procedure to make sure only one row is selected at a time.
    Just look at Query SQL Statement part ubnder this link,
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Regards,
    Bhavesh

  • Update- statement in JDBC sender Adapter

    Hi ,
    I have a requirement where I am trying to fetch data from ODS based on some flag and immediately I want to update the flag status . So I used selected and update in JDBC sender adapter .
    But I have one question , in the small timeframe where  XI has done a select and just before  XI could  issue the update statement  if a new record is added to ODS . Then  that new record will also get updated though it wasnot selected in select statement .
    Can someone let me know how to overcome this problem ; as I want to make sure I update only those recrods which are selected in select statement ??
    Thanks & Regards,
    Suvarna

    Hi,
    Check out the following thread. It gives the exact answer to this question.
    JDBC Sender Update Query
    One of the replies in the above thread:
    I put in an OSS note asking this exact question with your specific example, and got a reply. I was referred to OSS note 0000831162, where it is explained very unambiguously that the SELECT and UPDATE queries are run in the same transaction.
    Regards,
    P.Venkat
    Message was edited by:
            Venkataramanan

  • Select and update rownum sender jdbc

    Dear all
    i am using PI 7.31 sender jdbc adapter.
    table(TB_AA)  has 10000 row with pi_stat = 'R'   and then  sender jdbc adapter tried  10 row  in using rownum  every  120 second and update same rownum
    but  result of select query and udpate query  were different.  not same record update for selecting data.
    co_cd,  memid  is PK.
    select co_cd , mem_id,  reg_n  FROM TB_AA  where PI_STAT = 'R' AND rownum <= 10
    update  TB_AA  set  PI_STAT = 'S', where  PI_STAT = 'R' and rownum <= 10
    query is wrong?  ,  what is correct update query with several PK ?

    Hi Arten Solohin.
    co_cd,  memid  is Primary Key.
    select co_cd , mem_id,  reg_n  FROM TB_AA  where PI_STAT = 'R' AND rownum <= 10
    update  TB_AA  set  PI_STAT = 'S', where  PI_STAT = 'R' and rownum <= 10
    could you make your query with above my query ?  because i am confusing ORDER BY <your unique id_field>   AND LINE_ID ....
    will be highly appreciated  in advance
    thanks you very much.

  • Whats wrong with my UPDATE query?????????

    Hi friends,
    I used an update query in my project but it doesnt seems to be work fine.
    And here is my query:
    String SQL1="UPDATE tbl_rmadetails SET serial_no="+serial_no+" AND replaced_serial_no="+replaced_serial_no+" AND status="+status+"AND customer_id="+custo+"AND item_id="+ite+" WHERE customer_id="+custo+"AND item_id="+ite;
    Did i mess up the query..
    Is it?
    If not then whats the problem.
    I use PreparedStatement to execute the query.
    Any help will be appreciated

    So if i have 16 fields and i want to update only 5 fields means i gotta leave other fields like the below one..
    String SQL2="UPDATE tbl_rmadetails SET serial_no="+serial_no+","+ "replaced_serial_no="+replaced_serial_no+","+ "status="+status+","+"customer_id="+custo+"," +"item_id="+ite+"WHERE customer_id="+custo+"AND item_id="+ite+" AND serial_no="+serial_no;
                             ps=con.prepareStatement(SQL2);
                             ps.setString(3,custo);
                             ps.setString(4,ite);
                             ps.setInt(8,serial_no);
                             ps.setInt(10,replaced_serial_no);
                             ps.setString(11,status);
                             x=ps.executeUpdate();It gives me an error like this one in my console...
    java.sql.SQLException: Parameter index out of range (3 > 0).
            at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:2
    001)
            at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:110
    3)
            at com.rajk.javacode.servlets.RMAEntryModel.updateOut(RMAEntryModel.java
    :310)
            at com.rajk.javacode.servlets.RMAOutServlet.doPost(RMAOutServlet.java:31
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:175)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
    a:286)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
    ss(Http11Protocol.java:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
    7)
            at java.lang.Thread.run(Unknown Source)I dont want to update other fields.. i leave them as it is.. i juz want to know whether i could update only necessary fields out of all?
    ANyhelp would be appreciated

  • Update query in jdo

    I am looking for update query in KODO 4.0. How can I use named query to update "all Companies with number fo employers less then 10" ?
    I seen kodo.query.Query::updateAll method but not able to get an instance of it, because it seems to be reserved for jpa interfaces only...
    any idea ?
    regards
    Andre Teshler

    Hi have found the way to issue update query:
    String queryString =
                   "update buying.changetrackingexportentry " +
                   " set id_confirmedstate = " + state.getId() +
                   " where id_confirmedstate = " + state.getId()
                   +
                   " and id_changeexportregistration in" +
                   " (select id from buying.changeexportregistration where id_externalprocess=" + exportId + ")"
    Query query = (Query)getJdoTemplate().execute(new QueryCallback(queryString));
    ((kodo.jdo.QueryImpl)query).updatePersistentAll(params);
    Unfortunately at runtime this results in:
    <2|false|4.0.0> kodo.jdo.DataStoreException: ORA-00900: Ungültige SQL-Anweisung
         at kodo.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4092)
         at kodo.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:82)
         at kodo.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:66)
         at kodo.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:46)
         at kodo.jdbc.kernel.SQLStoreQuery$SQLExecutor.executeQuery(SQLStoreQuery.java:253)
         at kodo.kernel.QueryImpl.execute(QueryImpl.java:1132)
         at kodo.kernel.QueryImpl.updateInMemory(QueryImpl.java:1263)
         at kodo.kernel.AbstractStoreQuery$AbstractExecutor.executeUpdate(AbstractStoreQuery.java:157)
         at kodo.kernel.AbstractStoreQuery$AbstractExecutor.executeUpdate(AbstractStoreQuery.java:163)
         at kodo.kernel.QueryImpl.update(QueryImpl.java:1240)
         at kodo.kernel.QueryImpl.execute(QueryImpl.java:957)
         at kodo.kernel.QueryImpl.updateAll(QueryImpl.java:1012)
         at kodo.kernel.DelegatingQuery.updateAll(DelegatingQuery.java:865)
         at kodo.jdo.QueryImpl.updatePersistentAll(QueryImpl.java:815)
         at com.ottogroup.buying.infrastructure.dao.masterdatachange.jdo.ChangeTrackingExportEntryRepositoryDaoJdoImpl.updateConfirmedStateToExportedByConfirmedStateAndExportId(ChangeTrackingExportEntryRepositoryDaoJdoImpl.java:133)
         at com.ottogroup.buying.sharedkernel.object.masterdatachange.changeexport.ChangeTrackingExportEntryRepositoryImpl.updateConfirmedStateToExportedByConfirmedStateAndExportId(ChangeTrackingExportEntryRepositoryImpl.java:78)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
         at $Proxy161.updateConfirmedStateToExportedByConfirmedStateAndExportId(Unknown Source)
         at com.ottogroup.buying.sharedkernel.service.changeexport.ChangeExportServiceImpl.export(ChangeExportServiceImpl.java:177)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
         at com.ottogroup.buying.sharedkernel.object.base.error.AopMessageHandler.invoke(AopMessageHandler.java:38)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
         at $Proxy168.export(Unknown Source)
         at test.ottogroup.sharedkernel.object.persistence.base.ChangeExportTest.export(ChangeExportTest.java:146)
         at test.ottogroup.sharedkernel.object.persistence.base.ChangeExportTest.testAll(ChangeExportTest.java:158)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    NestedThrowablesStackTrace:
    java.sql.SQLException: ORA-00900: Ungültige SQL-Anweisung
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
         at oracle.jdbc.driver.T4C8Odscrarr.receive(T4C8Odscrarr.java:214)
         at oracle.jdbc.driver.T4CCallableStatement.doDescribe(T4CCallableStatement.java:731)
         at oracle.jdbc.driver.OracleStatement.describe(OracleStatement.java:3458)
         at oracle.jdbc.driver.OracleResultSetMetaData.<init>(OracleResultSetMetaData.java:57)
         at oracle.jdbc.driver.OracleResultSetImpl.getMetaData(OracleResultSetImpl.java:138)
         at com.solarmetric.jdbc.DelegatingResultSet.getMetaData(DelegatingResultSet.java:363)
         at kodo.jdbc.kernel.SQLProjectionResultObjectProvider.<init>(SQLProjectionResultObjectProvider.java:43)
         at kodo.jdbc.kernel.SQLStoreQuery$SQLExecutor.executeQuery(SQLStoreQuery.java:245)
         at kodo.kernel.QueryImpl.execute(QueryImpl.java:1132)
         at kodo.kernel.QueryImpl.updateInMemory(QueryImpl.java:1263)
         at kodo.kernel.AbstractStoreQuery$AbstractExecutor.executeUpdate(AbstractStoreQuery.java:157)
         at kodo.kernel.AbstractStoreQuery$AbstractExecutor.executeUpdate(AbstractStoreQuery.java:163)
         at kodo.kernel.QueryImpl.update(QueryImpl.java:1240)
         at kodo.kernel.QueryImpl.execute(QueryImpl.java:957)
         at kodo.kernel.QueryImpl.updateAll(QueryImpl.java:1012)
         at kodo.kernel.DelegatingQuery.updateAll(DelegatingQuery.java:865)
         at kodo.jdo.QueryImpl.updatePersistentAll(QueryImpl.java:815)
         at com.ottogroup.buying.infrastructure.dao.masterdatachange.jdo.ChangeTrackingExportEntryRepositoryDaoJdoImpl.updateConfirmedStateToExportedByConfirmedStateAndExportId(ChangeTrackingExportEntryRepositoryDaoJdoImpl.java:133)
         at com.ottogroup.buying.sharedkernel.object.masterdatachange.changeexport.ChangeTrackingExportEntryRepositoryImpl.updateConfirmedStateToExportedByConfirmedStateAndExportId(ChangeTrackingExportEntryRepositoryImpl.java:78)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
         at $Proxy161.updateConfirmedStateToExportedByConfirmedStateAndExportId(Unknown Source)
         at com.ottogroup.buying.sharedkernel.service.changeexport.ChangeExportServiceImpl.export(ChangeExportServiceImpl.java:177)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
         at com.ottogroup.buying.sharedkernel.object.base.error.AopMessageHandler.invoke(AopMessageHandler.java:38)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
         at $Proxy168.export(Unknown Source)
         at test.ottogroup.sharedkernel.object.persistence.base.ChangeExportTest.export(ChangeExportTest.java:146)
         at test.ottogroup.sharedkernel.object.persistence.base.ChangeExportTest.testAll(ChangeExportTest.java:158)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Can someone post an example how to use updatePersistentAll() ?
    thanks
    Andre Teshler

  • If statement in update query

    I was wondering if you could have a cfif statement inside of a update query.  See example below.  Is there a better way of doing it? thanks.
    <cfquery DATASOURCE="xxx" name="update">
      UPDATE plant_gen_info
            SET levels_complete = #URL.var0#
                <cfif IsDefined("URLvar13">
                ,Q1_answer = #URL.var13#
                </cfif>
            WHERE ID = #session.member_id#
      </cfquery>

    TheScarecrow,
    Yes, dynamic query statements can be assembled using <cfif>.  I would suggest you switch your IsDefined() to a StructKeyExists() and strongly suggest you make good use of <cfqueryparam>:
    <cfquery DATASOURCE="xxx" name="update">
      UPDATE plant_gen_info
            SET levels_complete = <cfqueryparam value="#URL.var0#" cfsqltype="****">
                <cfif StructKeyExists(URL, "var13")>
                ,Q1_answer = <cfqueryparam value="#URL.var13#" cfsqltype="****">
                </cfif>
            WHERE ID = <cfqueryparam value="#session.member_id#" cfsqltype="****">
      </cfquery>
    I put a "****" placeholder for cfsqltype attributes because I'm not sure which would be appropriate for your variables.  See the help docs for more on the cfqueryparam and cfsqltype.
    -Carl V.

  • Insert and update query to calculate the opening and closing balance

    create table purchase(productid number(5) ,dateofpurchase date,
    qty number(5));
    create table inventory(invid number(5),productid number(5),
    idate date,openingqty number(5),closingqty number(5));
    Records in inventory:
    1,1,'01-jan-2009', 10, 20
    2,1,'03-jan-2009', 20, 30
    3,1,'04-jan-2009', 40, 50
    when I enter the purchase invoice for 15 qty on 02-jan-2009
    after say '15-jan-09' , a new record should get inserted
    with opening balance = (closing balance before 02-jan-2009)
    and all the opening and closing balance for that product should
    get affected.
    If the invoice for 20 qty is entered for the existing date say
    '03-jan-2009' in inventory , then the closing balance
    for 03-jan-2009 should get updated and all the following records
    should get affected.
    I need the insert for the first one and update query for the
    second one.
    Vinodh

    <strike>You can do this in one statement by using the merge statement</strike>
    Hmm, maybe I spoke too soon.
    Edited by: Boneist on 25-Sep-2009 13:56
    Thinking about it, why do you want to design your system like this?
    Why not simply have your purchases table hold the required information and then either work out the inventory on the fly, or have a job that calls a procedure to add a row for the previous day?
    If you continue with this design, you're opening yourself up to a world of pain - what happens when the data doesn't match the purchases table? Also when is the inventory cut-off to reset the opening/closing balances? Monthly? Annually? Weekly? If it's set to one of those, what happens when the business request the inventory for a particular week?
    Edited by: Boneist on 25-Sep-2009 13:59

Maybe you are looking for

  • Im going to hong kong do i need an adaptor

    As it says above Im going to HK and bringing my 3 year old powerbook. Do I need an adapter to plug my PB into an outlet. It appears it will take the voltage (220) per specs. I have a 0 - 1875 converter but it says not to use it with computers. Any ad

  • Pre ordering iphone 5 for store pickup

    Is there no option to pre order for store pick up? I don't want to have it posted. Cheers

  • After submitting adobe forms, nothing happens

    Hi Guys, Our scenario is, from R/3 Enterprise we are RFCing to NW04s based adobe system. The form gets displayed in R/3 and then after keyin the input, it submitted. At this moment, nothing is happening, I wonder if the relevant event is getting trig

  • How to Run Multiple BAPI's

    Hi All, i was trying to run multiple BAPI's using Jco. but no luck. it giving error message like "Employee/person not locked yet". the BAPI's i'm trying are 1. BAPI_EMPLOYEET_ENQUEUE 2. BAPI_ABSENCE_REQUEST 3. BAPI_TRANSACTION_COMMIT 4. BAPI_EMPLOYEE

  • Issues with Flash Player and Safari 6

    I downloaded and installed the latest Flash Player but it still tells me on youtube and anywhere else to install the Flash Player. I tryed it many times but I can't get it to work. Please help thanks. Safari 6.0.4 Mountain Lion 10.8.3 Flash Player Ve